syntaqlite - A SQL parser, formatter, validator, and language server based on SQLite's own grammar and tokenizer
Key point
A SQL parser, formatter, and LSP tool built by directly compiling SQLite's grammar has been released.
Details
This tool directly compiles SQLite's Lemon-generated grammar and tokenizer into C. It reduces the limitations of general-purpose SQL parsers that only approximate SQLite, providing parsing and validation tailored to SQLite's own grammar.
- Performs schema validation without a DB connection, catching errors at the
sqlite3_preparelevel. - Unlike
sqlite3, it reports all errors in a single pass, along with source locations and suggested fixes. - Allows pinning to a specific SQLite version with
--sqlite-version 3.32.0, enabling detection of syntax unsupported in older SQLite environments such as Android. - Reflects 22 compile-time flags such as
SQLITE_ENABLE_MATH_FUNCTIONS, performing validation that matches the target build.
Against an upstream test suite of about 396,000 statements, it reports a 99.7% parsing acceptance match rate. It also includes a deterministic SQL formatter supporting line width, keyword casing, and indentation settings.
It additionally includes an experimental feature that extracts SQL embedded in Python/TypeScript strings, handling interpolation holes before validation. Project-specific glob schema mappings and format options are managed via syntaqlite.toml, and this configuration is shared across the LSP, CLI, and editor.
- LSP support: plugins provided for VS Code, Zed, and Claude Code
- Web Playground: runs in the browser via WASM
- Distribution formats: Rust, Python, JavaScript(WASM), C library
- Implementation: parser and tokenizer in C, formatter, validator, and LSP in Rust
- License: Apache 2.0
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.