docgen: add execute_stmt diagram with inline parameter demo#35
Open
ebembi-crdb wants to merge 1 commit into
Open
docgen: add execute_stmt diagram with inline parameter demo#35ebembi-crdb wants to merge 1 commit into
ebembi-crdb wants to merge 1 commit into
Conversation
Add a new `execute_stmt` diagram to demonstrate:
1. How to add a new diagram to diagrams.go
2. How the `inline` parameter surfaces nested grammar elements
3. The required Bazel file updates for new diagrams
The execute_stmt diagram uses:
- `inline: []string{"execute_param_clause", "expr_list"}` to surface the
parameter clause contents instead of just showing the element name
- `replace` to rename `table_alias_name` to the more readable `name`
- `unlink` to remove the hyperlink from `name`
Bazel files updated:
- pkg/gen/diagrams.bzl (added execute_stmt.html)
Note: BUILD.bazel, bnf.bzl, and docs.bzl already had execute_stmt entries.
Release note: None
Epic: None
SQL Diagram Generation Report✅ Validation Passed 🔄 Diagram changes detected Changed Diagram Previewsexecute Showing 1 changed diagram(s). Only diagrams that differ from master are shown. SKIP DOC Warnings (click to expand)The following grammar rules are suppressed from documentation: This comment was generated by the SQL Diagram CI workflow. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR demonstrates adding a new SQL diagram with the
inlineparameter to surface nested grammar elements.What this PR does
execute_stmtdiagram todiagrams.goinlineparameter to surfaceexecute_param_clauseandexpr_listcontentspkg/gen/diagrams.bzl) for the new diagramThe inline parameter explained
From the SQL grammar,
execute_stmtis defined as:Where
execute_param_clauseis:Without inline: The diagram shows
execute_param_clauseas an opaque boxWith inline: The diagram surfaces the contents, showing the optional parenthesized expression list
{ name: "execute_stmt", inline: []string{"execute_param_clause", "expr_list"}, // <-- surfaces these replace: map[string]string{"table_alias_name": "name"}, unlink: []string{"name"}, }Bazel file requirements
When adding a new diagram, these files need entries:
docs/generated/sql/bnf/BUILD.bazel- ✓ (already existed)pkg/gen/bnf.bzl- ✓ (already existed)pkg/gen/diagrams.bzl- added execute_stmt.htmlpkg/gen/docs.bzl- ✓ (already existed)Test plan
execute_stmtdiagram previewexecute_param_clausecontents