Open
Conversation
Adds a built-in SQL pretty-printer that formats messy queries into well-indented, readable SQL using the existing AST parse→compile pipeline. Triggered via Ctrl+Shift+F in the editor. - New `ast::formatter` module with `format_sql()` function - Multi-line output: each SQL clause (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY, LIMIT, OFFSET) on its own line - Indented column lists for multi-column SELECT - JOIN conditions indented under their JOIN clause - Supports all query types: SELECT, INSERT, UPDATE, DELETE, CTEs - Non-destructive: shows toast error on parse failure - Single undo step to revert formatting - 16 unit tests including round-trip reparse verification - Help overlay updated with new shortcut Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolve merge conflicts in app.rs and components.rs by keeping both the SQL formatter feature and autocomplete additions from main. Run cargo fmt for consistent formatting. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Implements #33 — adds a built-in SQL query formatter that auto-formats messy or one-line SQL into well-indented, readable SQL directly in the editor.
ast::formattermodule withformat_sql()function that pretty-prints Query AST nodesCtrl+Shift+Fin the editor formats the entire bufferExample
Before (single line):
After (Ctrl+Shift+F):
Test plan
cargo buildcompiles without warningscargo test— all 232 tests pass (16 new formatter tests)Closes #33
🤖 Generated with Claude Code