From 528ffd6e4df34b3f753edfaa849085332264c441 Mon Sep 17 00:00:00 2001 From: Kathryn Hancox Date: Thu, 9 Feb 2023 16:33:41 -0500 Subject: [PATCH] diagrams: updated the create schedule for changefeed diagram Previously, the parameters were not descriptive for the synopsis The update will make it easier to document parameters Included some inline elements and replaces Epic: none Release note: None --- .../sql/bnf/create_schedule_for_changefeed_stmt.bnf | 11 +++++++++-- pkg/cmd/docgen/diagrams.go | 11 +++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/generated/sql/bnf/create_schedule_for_changefeed_stmt.bnf b/docs/generated/sql/bnf/create_schedule_for_changefeed_stmt.bnf index 436a9b4c1ff0..c59555d6a13c 100644 --- a/docs/generated/sql/bnf/create_schedule_for_changefeed_stmt.bnf +++ b/docs/generated/sql/bnf/create_schedule_for_changefeed_stmt.bnf @@ -1,3 +1,10 @@ create_schedule_for_changefeed_stmt ::= - 'CREATE' 'SCHEDULE' schedule_label_spec 'FOR' 'CHANGEFEED' changefeed_targets changefeed_sink opt_with_options cron_expr opt_with_schedule_options - | 'CREATE' 'SCHEDULE' schedule_label_spec 'FOR' 'CHANGEFEED' changefeed_sink opt_with_options 'AS' 'SELECT' target_list 'FROM' changefeed_target_expr opt_where_clause cron_expr opt_with_schedule_options + 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' changefeed_target ( ( ',' changefeed_target ) )* ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'RECURRING' crontab 'WITH' 'SCHEDULE' 'OPTIONS' schedule_option + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' changefeed_target ( ( ',' changefeed_target ) )* ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'RECURRING' crontab 'WITH' 'SCHEDULE' 'OPTIONS' '(' schedule_option ')' + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' changefeed_target ( ( ',' changefeed_target ) )* ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'RECURRING' crontab + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'AS' 'SELECT' target_list 'FROM' insert_target where_clause 'RECURRING' crontab 'WITH' 'SCHEDULE' 'OPTIONS' schedule_option + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'AS' 'SELECT' target_list 'FROM' insert_target where_clause 'RECURRING' crontab 'WITH' 'SCHEDULE' 'OPTIONS' '(' schedule_option ')' + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'AS' 'SELECT' target_list 'FROM' insert_target where_clause 'RECURRING' crontab + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'AS' 'SELECT' target_list 'FROM' insert_target 'RECURRING' crontab 'WITH' 'SCHEDULE' 'OPTIONS' schedule_option + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'AS' 'SELECT' target_list 'FROM' insert_target 'RECURRING' crontab 'WITH' 'SCHEDULE' 'OPTIONS' '(' schedule_option ')' + | 'CREATE' 'SCHEDULE' ( 'IF NOT EXISTS' | ) schedule_label 'FOR' 'CHANGEFEED' ( 'INTO' changefeed_sink ) ( | 'WITH' changefeed_option ( ',' changefeed_option )* ) 'AS' 'SELECT' target_list 'FROM' insert_target 'RECURRING' crontab diff --git a/pkg/cmd/docgen/diagrams.go b/pkg/cmd/docgen/diagrams.go index 65e5d2bcd1eb..9dc1137fbec2 100644 --- a/pkg/cmd/docgen/diagrams.go +++ b/pkg/cmd/docgen/diagrams.go @@ -773,6 +773,17 @@ var specs = []stmtSpec{ "kv_option_list": "schedule_option"}, unlink: []string{"schedule_label", "collection_URI", "crontab", "schedule_option"}, }, + { + name: "create_schedule_for_changefeed_stmt", + inline: []string{"opt_with_schedule_options", "changefeed_targets", "table_pattern", "opt_where_clause", "changefeed_target_expr", "cron_expr"}, + replace: map[string]string{ + "schedule_label_spec": "( 'IF NOT EXISTS' | ) schedule_label", + "changefeed_sink": "( 'INTO' changefeed_sink )", + "sconst_or_placeholder": "crontab", + "kv_option_list": "schedule_option", + "opt_with_options": "( | 'WITH' changefeed_option ( ',' changefeed_option )* )"}, + unlink: []string{"schedule_label", "schedule_option", "changefeed_sink", "changefeed_option", "crontab"}, + }, { name: "create_schema_stmt", inline: []string{"qualifiable_schema_name", "opt_schema_name", "opt_name"},