simonw / datasette

An open source multi-tool for exploring and publishing data
https://datasette.io
Apache License 2.0
9.49k stars 681 forks source link

Introduce a SQL statement parser in Python #665

Open simonw opened 4 years ago

simonw commented 4 years ago

254 and #653 are both examples of problems that could be solved using a real SQL parser in Python.

simonw commented 4 years ago

pyparsing has an example based on SQLite SELECT statements: https://github.com/pyparsing/pyparsing/blob/8d9ab59a2b2767ad56c9b852c325075113718c0a/examples/select_parser.py

https://github.com/lark-parser/lark is a relatively new (less than two years old) parsing library that looks promising too.