Skip to content

Commit

Permalink
bazel: add build target for generated bnf's
Browse files Browse the repository at this point in the history
Closes #65815.

Release note: None
  • Loading branch information
rickystewart committed Jul 26, 2021
1 parent a35b845 commit 9152842
Show file tree
Hide file tree
Showing 2 changed files with 240 additions and 5 deletions.
6 changes: 1 addition & 5 deletions docs/generated/sql/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ genrule(
"window_functions.md",
],
cmd = """
$(location //pkg/cmd/docgen) functions . --quiet
mv aggregates.md $(location aggregates.md)
mv functions.md $(location functions.md)
mv operators.md $(location operators.md)
mv window_functions.md $(location window_functions.md)
$(location //pkg/cmd/docgen) functions $(RULEDIR) --quiet
""",
exec_tools = ["//pkg/cmd/docgen"],
)
239 changes: 239 additions & 0 deletions docs/generated/sql/bnf/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
genrule(
name = "bnf",
srcs = ["//pkg/sql/parser:sql.y"],
outs = [
"abort_stmt.bnf",
"add_column.bnf",
"add_constraint.bnf",
"alter_column.bnf",
"alter_database_add_region_stmt.bnf",
"alter_database_drop_region.bnf",
"alter_database_owner.bnf",
"alter_database_primary_region.bnf",
"alter_database_stmt.bnf",
"alter_database_survival_goal_stmt.bnf",
"alter_database_to_schema_stmt.bnf",
"alter_ddl_stmt.bnf",
"alter_default_privileges_stmt.bnf",
"alter_index_partition_by.bnf",
"alter_index_stmt.bnf",
"alter_partition_stmt.bnf",
"alter_primary_key.bnf",
"alter_range_stmt.bnf",
"alter_rename_view_stmt.bnf",
"alter_role_stmt.bnf",
"alter_scatter_index_stmt.bnf",
"alter_scatter_stmt.bnf",
"alter_schema.bnf",
"alter_sequence.bnf",
"alter_sequence_options_stmt.bnf",
"alter_sequence_owner_stmt.bnf",
"alter_sequence_set_schema_stmt.bnf",
"alter_stmt.bnf",
"alter_table.bnf",
"alter_table_locality_stmt.bnf",
"alter_table_owner_stmt.bnf",
"alter_table_partition_by.bnf",
"alter_table_set_schema_stmt.bnf",
"alter_table_stmt.bnf",
"alter_type.bnf",
"alter_view.bnf",
"alter_view_owner_stmt.bnf",
"alter_view_set_schema_stmt.bnf",
"alter_zone_database_stmt.bnf",
"alter_zone_index_stmt.bnf",
"alter_zone_partition_stmt.bnf",
"alter_zone_range_stmt.bnf",
"alter_zone_table_stmt.bnf",
"analyze_stmt.bnf",
"backup.bnf",
"begin_stmt.bnf",
"begin_transaction.bnf",
"cancel_job.bnf",
"cancel_query.bnf",
"cancel_session.bnf",
"cancel_stmt.bnf",
"check_column_level.bnf",
"check_table_level.bnf",
"close_cursor_stmt.bnf",
"col_qualification.bnf",
"column_def.bnf",
"comment.bnf",
"commit_transaction.bnf",
"copy_from_stmt.bnf",
"create_as_col_qual_list.bnf",
"create_as_constraint_def.bnf",
"create_changefeed_stmt.bnf",
"create_database_stmt.bnf",
"create_ddl_stmt.bnf",
"create_extension_stmt.bnf",
"create_index_interleaved_stmt.bnf",
"create_index_stmt.bnf",
"create_inverted_index_stmt.bnf",
"create_replication_stream_stmt.bnf",
"create_role_stmt.bnf",
"create_schedule_for_backup_stmt.bnf",
"create_schema_stmt.bnf",
"create_sequence_stmt.bnf",
"create_stats_stmt.bnf",
"create_stmt.bnf",
"create_table_as_stmt.bnf",
"create_table_partition_by.bnf",
"create_table_stmt.bnf",
"create_type.bnf",
"create_view_stmt.bnf",
"deallocate_stmt.bnf",
"default_value_column_level.bnf",
"delete_stmt.bnf",
"discard_stmt.bnf",
"drop_column.bnf",
"drop_constraint.bnf",
"drop_database.bnf",
"drop_ddl_stmt.bnf",
"drop_index.bnf",
"drop_owned_by_stmt.bnf",
"drop_role_stmt.bnf",
"drop_schedule_stmt.bnf",
"drop_schema.bnf",
"drop_sequence_stmt.bnf",
"drop_stmt.bnf",
"drop_table.bnf",
"drop_type.bnf",
"drop_view.bnf",
"execute_stmt.bnf",
"experimental_audit.bnf",
"explain_analyze_stmt.bnf",
"explain_stmt.bnf",
"explainable_stmt.bnf",
"export_stmt.bnf",
"family_def.bnf",
"for_locking.bnf",
"foreign_key_column_level.bnf",
"foreign_key_table_level.bnf",
"generic_set.bnf",
"grant_stmt.bnf",
"import_csv.bnf",
"import_dump.bnf",
"import_into.bnf",
"index_def.bnf",
"insert_rest.bnf",
"insert_stmt.bnf",
"interleave.bnf",
"iso_level.bnf",
"joined_table.bnf",
"like_table_option_list.bnf",
"limit_clause.bnf",
"not_null_column_level.bnf",
"offset_clause.bnf",
"on_conflict.bnf",
"opt_frame_clause.bnf",
"opt_interleave.bnf",
"opt_locality.bnf",
"opt_persistence_temp_table.bnf",
"opt_with_storage_parameter_list.bnf",
"pause_job.bnf",
"pause_schedule.bnf",
"pause_stmt.bnf",
"preparable_stmt.bnf",
"prepare_stmt.bnf",
"primary_key_column_level.bnf",
"primary_key_table_level.bnf",
"reassign_owned_by_stmt.bnf",
"refresh_materialized_views.bnf",
"release_savepoint.bnf",
"rename_column.bnf",
"rename_constraint.bnf",
"rename_database.bnf",
"rename_index.bnf",
"rename_sequence.bnf",
"rename_table.bnf",
"reset_csetting_stmt.bnf",
"reset_session_stmt.bnf",
"reset_stmt.bnf",
"restore.bnf",
"resume_job.bnf",
"resume_schedule.bnf",
"resume_stmt.bnf",
"revoke_stmt.bnf",
"rollback_transaction.bnf",
"row_source_extension_stmt.bnf",
"savepoint_stmt.bnf",
"scrub_database_stmt.bnf",
"scrub_stmt.bnf",
"scrub_table_stmt.bnf",
"select_clause.bnf",
"select_stmt.bnf",
"set_cluster_setting.bnf",
"set_csetting_stmt.bnf",
"set_exprs_internal.bnf",
"set_operation.bnf",
"set_rest_more.bnf",
"set_session_stmt.bnf",
"set_transaction.bnf",
"set_transaction_stmt.bnf",
"set_var.bnf",
"show_backup.bnf",
"show_cluster_setting.bnf",
"show_columns_stmt.bnf",
"show_constraints.bnf",
"show_constraints_stmt.bnf",
"show_create_stmt.bnf",
"show_databases_stmt.bnf",
"show_enums.bnf",
"show_grants_stmt.bnf",
"show_index.bnf",
"show_indexes.bnf",
"show_jobs.bnf",
"show_keys.bnf",
"show_locality.bnf",
"show_locality_stmt.bnf",
"show_partitions_stmt.bnf",
"show_range_for_row_stmt.bnf",
"show_ranges_stmt.bnf",
"show_regions.bnf",
"show_roles_stmt.bnf",
"show_savepoint_status.bnf",
"show_schedules.bnf",
"show_schemas.bnf",
"show_sequences.bnf",
"show_session_stmt.bnf",
"show_sessions.bnf",
"show_statements.bnf",
"show_stats.bnf",
"show_survival_goal_stmt.bnf",
"show_tables.bnf",
"show_trace.bnf",
"show_transaction.bnf",
"show_transactions_stmt.bnf",
"show_types_stmt.bnf",
"show_users_stmt.bnf",
"show_var.bnf",
"show_zone_stmt.bnf",
"simple_select_clause.bnf",
"sort_clause.bnf",
"split_index_at.bnf",
"split_table_at.bnf",
"stmt.bnf",
"stmt_block.bnf",
"table_clause.bnf",
"table_constraint.bnf",
"table_ref.bnf",
"transaction_stmt.bnf",
"truncate_stmt.bnf",
"unique_column_level.bnf",
"unique_table_level.bnf",
"unsplit_index_at.bnf",
"unsplit_table_at.bnf",
"update_stmt.bnf",
"upsert_stmt.bnf",
"use_stmt.bnf",
"validate_constraint.bnf",
"values_clause.bnf",
"window_definition.bnf",
"with_clause.bnf",
],
cmd = """
$(location //pkg/cmd/docgen) grammar bnf $(RULEDIR) --quiet --addr $(location //pkg/sql/parser:sql.y)
""",
exec_tools = ["//pkg/cmd/docgen"],
)

0 comments on commit 9152842

Please sign in to comment.