Skip to content

Wire query plan rendering into --plan-format - #96

Merged
apstndb merged 3 commits into
mainfrom
feat/cli-plan-render
Sep 12, 2026
Merged

Wire query plan rendering into --plan-format#96
apstndb merged 3 commits into
mainfrom
feat/cli-plan-render

Conversation

@apstndb

@apstndb apstndb commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Extend --plan-format from JSON/YAML envelopes to text, DOT, Mermaid, D2, SVG, and PNG through the existing in-process renderer. Add format-specific tuning flags, reject inapplicable combinations, and refuse PNG output to a terminal before executing SQL.

Rendering shares the prepared command and result-output paths: graph query text comes from the frozen SQL statement, caller cancellation reaches rendering, and renderer errors after committed DML never replay the statement. A completed primary output is published even when rendering fails; the previous plan file remains intact. Read-only CSV and lazy jq retain streaming behavior.

Validation: go build ./..., full go test ./... with the Spanner emulator, and golangci-lint v2.12.2 passed. Tests cover text/graph/image output, TTY and flag validation, frozen SQL file contents, cancellation, and post-commit renderer failure across JSON/YAML/CSV. Managed Spanner and Windows runtime were not tested.

Extend split-mode --plan-format beyond json/yaml so text and graph
renderers run in-process after the query, with flag validation and a
TTY refusal for PNG.
@apstndb
apstndb merged commit fb76054 into main Sep 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant