feat(sql): add the traceroot sql schema command + docs#31
Draft
dark-sorceror wants to merge 3 commits into
Draft
feat(sql): add the traceroot sql schema command + docs#31dark-sorceror wants to merge 3 commits into
traceroot sql schema command + docs#31dark-sorceror wants to merge 3 commits into
Conversation
5 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
Fixes #28
Adds
traceroot sql schema— schema introspection for the SQL Query Gateway, framed as analytical export — plus the README docs for the wholesqlfeature. Users can discover the curatedspans/tracescolumns and types before writing queries, and are clearly told thatinput/output/metadatablobs are excluded from the analytical export.How it works
registerSqlSchema(sql)is wired into thesqlgroup before the default query action, sotraceroot sql schemaresolves as a subcommand whiletraceroot sql "<query>"still runs the query.What's included
sql schemasubcommand (src/commands/sql/schema.ts,src/commands/sql.ts)input/output/metadatablobs are excluded, with a neutral reference to a possible future opt-in — no flag name promised) followed by a 3-columnTABLE | COLUMN | TYPEaligned table with a bold header, consistent withtraces list.--json: emits the raw schema plus a top-levelnotefield —"Analytical export schema. input/output/metadata blobs excluded from MVP."— built as an explicit object (intentionally not typed asSqlSchemaResponse).[query]argument.Docs (
README.md)span_start_time/trace_start_time, the output-mode summary (table /--json/--csv/--output), and the blobs-excluded framing.Test plan
spans/span_id/traces/trace_idafter theAnalytical export schemapreamble--jsonparses to the raw schema plus the exactnotefieldinput/output/metadatanever appear as schema columns in either mode (asserted against the rendered table cells and the JSON column names — not a naive substring scan, since those words legitimately appear in the preamble)traceroot sql schemaresolves as a subcommand (not as a query string"schema");registertest covers theschemasubcommand undersqlnpm run build,npm run lint,npm run format:checkclean; full Vitest suite greentraceroot sql schema) — not run here; no live SQL Gateway availableSummary by cubic
Adds the
traceroot sql schemacommand for schema introspection of the analytical export and updates the README with SQL usage examples. This lets users see available tables, columns, and types before querying;input/output/metadatablobs are excluded.traceroot sql schema: shows the analytical export schema (tables, columns, types). Blobs (input,output,metadata) are excluded.--jsonreturns{ tables, note }.schemaresolves as a subcommand, not a query string.Written for commit f79442a. Summary will update on new commits.