SQLite User Forum

sqlite syntax into AST
Login

sqlite syntax into AST

(1) By StevenACoffman on 2021-11-03 01:20:36 [source]

So I would like to improve support for compiling sqlite queries into type safe Go using sqlc (see https://github.com/kyleconroy/sqlc/issues/161 ). However, it looks like while a full AST is generated for SELECT statements, for INSERT, DELETE, UPDATE, CREATE, DROP, and so forth, no AST is ever constructed. In addition, the AST seems like it changes often (and for good reasons) so it's not as stable as an API.

However, I'm wondering if people who are more steeped in the sqlite ecosystem (and the excellent work behind Lemon in general), have alternative suggestions. Is there some way to use sqlite itself (or it's code) to parse sqlite dialect queries into something structured in a stable way that doesn't hold back sqlite development?

Thanks for any ideas or resources I should look at.

Best, -Steve