3 ms·
> In theory, you could parse the SQL and build up some kind of AST on which compatibility could be built. This is an interesting problem that I'd like to learn
by MathMonkeyMan 2y ago
> In theory, you could parse the SQL and build up some kind of AST on which compatibility could be built.
This is an interesting problem that I'd like to learn more about. Have you read anything about it?
- ajfriend 2y agoYou can compose SQL with https://ibis-project.org/tutorials/ibis-for-sql-users https://ibis-project.org/tutorials/ibis-for-sql-users, which is using https://github.com/tobymao/sqlglot https://github.com/tobymao/sqlglot to parse the SQL under the hood. As an alternative to parsing the SQL yourself, DuckDB's https://duckdb.org/docs/api/python/relational_api https://duckdb.org/docs/api/python/relational_api allows you to compose SQL expressions efficiently and lazily, which I've used when playing around with things like https://gist.github.com/ajfriend/eea0795546c7c44f1c24ab0560a846b9 https://gist.github.com/ajfriend/eea0795546c7c44f1c24ab0560a...