Building Syntaqlite with AI: Real Talk on Devtools for SQLite π₯
Yo, dude, this post is goldβLalit spent 8 years dreaming of killer SQLite devtools (formatter, linter, LSP), then crushed it in 3 months (~250 hrs) using AI agents like Claude Code. But it's no fairy tale; he breaks down the wins and the pains. Let's unpack the big ideas without the hype. π
WHY SQLite Devtools Sucked (The Pain That Killed Motivation) π
Before: SQLite powers everythingβphones, browsers, embedded systemsβbut devtools? Trash.
- No reliable parser: Existing ones approximated SQL, broke on edge cases (e.g., ate comments, ignored virtual tables).
- No formal spec or stable parser API. SQLite skips parse trees entirely, jumps straight to bytecode. π€―
- Dense C codebase: 400+ grammar rules, fiendishly hard to grok.
- Result? Formatters/linters slow, unreliable. For Lalit's PerfettoSQL (SQLite extension), workarounds everywhere.
The "ohhh" moment: Perfect parsing unlocks everythingβaccurate trees for formatters, linters, VS Code smarts like TypeScript. But solo? Too hard + tedious for side project. Bugs, tests, docs? Motivation killer.
PROBLEM (BEFORE) SOLUTION (SYNTAGQLITE)
ββββββββββββββββ ββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββ βββββββββββββββββββββββ
β Approx parsers β β ββββΊ β Exact parse tree β
β
β Breaks on edges β β Formatter/linter/ β
β Slow, unreliable β β LSP for *all* SQL β
β No PerfettoSQL β β Rust-powered, fast β
βββββββββββββββββββββββ βββββββββββββββββββββββ
BIG PICTURE: What Syntaqlite Is & Where It Fits β‘
Syntaqlite = High-fidelity SQLite devtools suite:
- Core: Parser extracted from SQLite source (tokenizer + Lemon-generated grammar).
- Built on: Parse tree (missing in SQLite) β powers formatter (Wadler-Lindig pretty-printing), linter, validator.
- Exposed as: CLI, LSP (VS Code/Zed extensions), Python/WASM bindings, playground.
- Fits: Any SQLite user, extensible to dialects like PerfettoSQL.
SQLite SQL βββΊ Tokenizer (C) βββΊ Grammar Rules (~400) βββΊ Parse Tree βββΊ Devtools
β
βΌ (AI helped generate/map rules)
Formatter/Linter/LSP/Validator
Not a DB wrapperβlanguage tools like Prettier + ESLint for SQL, but SQLite-precise.
HOW AI Made It Happen (Mechanics + Wins) β
Lalit vibe-coded first (delegate everything to Claude), got prototype + 500 tests, but spaghetti β full Rust rewrite with him owning design.
Step-by-step AI workflow:
- Overcome inertia: AI prototypes fast β concrete code to critique, not endless head-thinking.
- Churn obvious code: AI > human for "standard" stuff (docs, consistent style). Broke problems into "write func X with Y params."
- Refactor loop: Generate β review β AI refactor β human taste-check. Constant, or codebase rots.
- Research TA: Explained Wadler-Lindig printing, Rust tooling, LSP APIs in convos. Hours β minutes.
- Last-mile polish: Extensions, docs, packagingβeach a "weekend project," AI made 'em cheap.
- Scaffolding: Upstream SQLite tests (1.3k files) validate parser matches real SQLite exactly.
AI shine zones:
βββββββββββββββββββββββββββββββ
β AI KILLS IT β
β
βββββββββββββββββββββββββββββββ€
β β’ Obvious impl (funcs/classes)β
β β’ Refactors at scale β
β β’ Research/new domains β
β β’ Parser rule gen (w/ review)β
β β’ UX prototypes β
βββββββββββββββββββββββββββββββ
β "Relativity"
βΌ Knows what you know
βββββββββββββββββββββββββββββββ
β AI SUCKS β β
βββββββββββββββββββββββββββββββ€
β β’ Architecture/design β
β β’ Taste (API feel) β
β β’ History/time sense β
β β’ Unverifiable tasks β
βββββββββββββββββββββββββββββββ
Result: Shipped complete (0.1 in Mar 2026). Without AI? Smaller, no extensions/docs.
The Dark Side: AI Costs & Pitfalls π±
AI ain't free. Lalit calls it out raw.
Biggest traps:
- Addiction loop: Slot machine vibesβ"one more prompt." Tired? Vague prompts β slop β more tries β exhaustion.
- Losing touch: Skip reading code β mental model fades β bad comms w/ AI ("fix the thing that does Bar").
- Design procrastination: Easy refactor β defer decisions β confusing codebase β clear thinking dies.
- False security: 500+ tests? Still scrapped prototype. No crystal ball for edges.
- No time sense: AI forgets evolution/history. Humans carry "why this API changed" implicitly.
Fixes he learned:
- Own all decisions upfront.
- Read/review every change.
- Tight process: Design β scaffold (lints/tests) β generate β refactor β audit.
- Stay "in touch"βmanual code walks.
AI USER SKILL MAP (Lalit's "Relativity")
βββββββββββββββββββββββββββββββ
Your Expertise ββββββΊ AI Win %
Known + verifiable ββΊ 100% π (parser rules)
Known + fuzzy βββββββΊ 70% (formatter)
Unknown βββββββββββββΊ 20% π (arch)
LOCK IT IN: TL;DR π₯
- Why Syntaqlite? SQLite huge, devtools weak β exact parser unlocks pro tools.
- AI force-multiplier: Impl/research speed β bigger project, but you drive design/taste.
- Golden rule: Concrete + verifiable = AI godmode. Abstract/global = human only.
- Burn this: Vibe-code prototypes, rewrite structured. Refactor relentlessly or die.
Trackin'? Syntaqlite GitHub = here. Deeper on parsers/AI workflows? Hit me. π