Skip to content

Commit

Permalink
Merge #96907
Browse files Browse the repository at this point in the history
96907: diagrams: updated the create schedule for changefeed diagram r=nickvigilante a=kathancox

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

Co-authored-by: Kathryn Hancox <kathryn@cockroachlabs.com>
craig[bot] and kathancox committed Feb 13, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 8511dc0 + 528ffd6 commit f015d22
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/generated/sql/bnf/create_schedule_for_changefeed_stmt.bnf
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions pkg/cmd/docgen/diagrams.go
Original file line number Diff line number Diff line change
@@ -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"},

0 comments on commit f015d22

Please sign in to comment.