Skip to content

Commit a6be40b

Browse files
committed
Add SQLite-as-parser proposal
SQLite exposes no parse tree; EXPLAIN QUERY PLAN is an execution plan, not an AST. At most a syntactic accept/reject classifier.
1 parent 49bfd8b commit a6be40b

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SQLite as the parser (proposal)
2+
3+
**Status:** proposal, not implemented. No code.
4+
5+
**Idea:** SQLite is already a dependency; for DML that overlaps SQLite syntax,
6+
lean on SQLite's own (fast, native) parser to classify or pre-parse queries, only
7+
falling back to the full MySQL parser for the rest.
8+
9+
**Caveat (important):** SQLite does NOT expose a parse tree/AST. `EXPLAIN QUERY PLAN`
10+
returns an *execution plan* (table scans, index usage, sort order — post-optimization),
11+
not a syntactic structure, and its output is documented as unstable. The most
12+
SQLite can give cheaply is syntactic accept/reject via `prepare()` — a coarse
13+
classifier with no structure to translate, and syntactic acceptance ≠ MySQL
14+
semantics anyway.
15+
16+
**Verdict:** at best a yes/no gate for trivial queries; can't supply an AST. Maybe a
17+
feasibility spike for the proxy. Not prototyped.

0 commit comments

Comments
 (0)