sqltree
sqltree copied to clipboard
A SQL parser
fix bug: -Cannot format `'select a from (select a from b) as a'` -Cannot parse `'select a from (select a from b)'`https://github.com/JelleZijlstra/sqltree/issues/87#issue-1699473176
`select 1 from (select a from b) as a` is working but `select 1 from (select a from b)` isn't
https://docs.aws.amazon.com/redshift/latest/dg/r_patternmatching_condition_like.html
e.g. with a as (select 1 from a union all select 2 from a) select 1
https://dev.mysql.com/doc/refman/8.0/en/window-functions-usage.html
MySQL supports queries like `SELECT COUNT(*) c FROM t`. We should support this but first I need to figure out what exactly the allowed syntax is.
We should provide a [Fixit](https://github.com/Instagram/Fixit) rule that formats SQL embedded in Python strings. Ideas for how it would work: - Configure a list of functions that map to Dialects (`presto.query`...
There should be a nicely usable API. Some ideas: ``` sqltree format "select *" # prints formatted SQL sqltree parse "select *" # prints pretty-printed parse tree sqltree translate --from=mysql...