Skip to content

Conversation

@kyleconroy
Copy link
Collaborator

Add a new parse subcommand that parses SQL and outputs the AST as JSON. This is useful for debugging and understanding how sqlc parses SQL statements.

The command requires the parsecmd experiment to be enabled via SQLCEXPERIMENT=parsecmd.

Usage:
sqlc parse --dialect postgresql|mysql|sqlite [file]

If no file is provided, reads from stdin.

🤖 Generated with Claude Code

Add a new `parse` subcommand that parses SQL and outputs the AST as JSON.
This is useful for debugging and understanding how sqlc parses SQL statements.

The command requires the `parsecmd` experiment to be enabled via
SQLCEXPERIMENT=parsecmd.

Usage:
  sqlc parse --dialect postgresql|mysql|sqlite [file]

If no file is provided, reads from stdin.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🔧 golang labels Dec 22, 2025
Match the style of other commands in cmd.go by using a global variable
and registering flags in init().

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@kyleconroy kyleconroy merged commit ba513e7 into main Dec 22, 2025
13 checks passed
@kyleconroy kyleconroy deleted the claude/add-parse-subcommand-BooXJ branch December 22, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files. 🔧 golang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants