Getting started

syntaqlite is a parser, formatter, validator, and language server for SQLite SQL. You can try it in the browser without installing anything, or install the CLI:

curl -sSf https://raw.githubusercontent.com/LalitMaganti/syntaqlite/main/tools/syntaqlite | python3 - fmt -e "select 1"

Downloads the binary on first run, caches it, auto-updates weekly. Works on macOS, Linux, and Windows.

mise use github:LalitMaganti/syntaqlite
pip install syntaqlite

Installs the CLI binary and Python library API. No Rust toolchain needed.

brew install LalitMaganti/tap/syntaqlite
cargo install syntaqlite-cli

Format

syntaqlite fmt -e "select id,name from users where active=1 and role='admin'"
SELECT id, name FROM users WHERE active = 1 AND role = 'admin';

Format a file in place with syntaqlite fmt -i query.sql, or check formatting in CI with syntaqlite fmt --check "**/*.sql".

Validate

syntaqlite reads your CREATE TABLE statements to build a schema, then validates queries against it without needing a database. It finds all errors in one pass, with source locations and did-you-mean suggestions:

syntaqlite validate -e "CREATE TABLE users (id, name, email); SELECT nme FROM users;"
warning: unknown column 'nme'
 --> <expression>:1:46
  |
1 | CREATE TABLE users (id, name, email); SELECT nme FROM users;
  |                                              ^~~
  = help: did you mean 'name'?

For real projects, separate your schema from your queries:

syntaqlite validate --schema schema.sql queries.sql

Parse

Inspect the full abstract syntax tree:

syntaqlite parse -e "SELECT 1 + 2"

Useful for code generation, migration tooling, or static analysis. See Rust API guide or Python library tutorial for details.