Open domoritz opened 3 months ago
This could be super useful for #510 but we probably want to consider revising the SQL representation in mosaic first.
Depending on how wide you're looking to go with multi database support beyond the DuckDB multi database support for Postgres/MySQL, could use something like this. Seems like lots of dialects are implemented; I'm sure DuckDB isn't too far from Postgres. Not too sure of quality, but seems reasonable?
Thanks for the link. I think we can make our lives a bit easier by generating SQL in different dialects from a structured format (which we already have in https://github.com/uwdata/mosaic/tree/main/packages/sql). But we need to make the current implementation more flexible.
Currently query analysis is only possible when using Mosaic’s SQL builder methods, which maintain a structured representation of the query. While arbitrary query expressions are allowed, they are not analyzed. This project would develop a SQL parser in JavaScript that we can use to parse SQL text into a structured representation such as an AST. DuckDB already has a parser in the JSON extension.