mosaic icon indicating copy to clipboard operation
mosaic copied to clipboard

Support Databases other than DuckDB

Open domoritz opened this issue 1 year ago • 9 comments

Create new connectors, for example to Postgres, Clickhouse, or Snowflake. Identify breakage points for Mosaic’s current SQL query generation and design solutions for translating from an internal "canonical" query language to different DB dialects.

A good starting point would be to leverage multi database support in DuckDB.

domoritz avatar May 23 '24 14:05 domoritz

working on this issue! and almost done!

weifanwu avatar May 24 '24 20:05 weifanwu

We're interested in BigQuery + StarRocks adapters. Once there's an adapter pattern, we'd be happy to help contribute SQL interface translations.

derekperkins avatar May 29 '24 01:05 derekperkins

I'm interested in Azure SQL and Azure Synapse databases.

MarcSkovMadsen avatar Jun 09 '24 13:06 MarcSkovMadsen

https://github.com/tobymao/sqlglot could be an interesting experiment to build a rest server that proxies queries to another database. I'm sure it's still tricky because of data loading but worth a try.

domoritz avatar Jun 10 '24 12:06 domoritz

Wrote documentation for how to connect (PostgreSQL, MySQL, SQLite) using DuckDB extensions:

https://github.com/uwdata/mosaic/pull/430

weifanwu avatar Jun 10 '24 23:06 weifanwu

I drafted PR #681 as an experiment to provide support to multiple databases using https://github.com/ibis-project/ibis which in turn uses https://github.com/tobymao/sqlglot under the hood, as suggested by @domoritz. What do you think about the approach?

peter-gy avatar Feb 07 '25 18:02 peter-gy

You're amazing! I have to dig deeper into your pull request but it looks very exciting.

domoritz avatar Feb 07 '25 19:02 domoritz

Wow, still need to review in detail but this looks really promising!

jheer avatar Feb 07 '25 19:02 jheer

@jheer / @domoritz How would you feel about having an option to send commands to the server as a json representation of the mosaic SQL AST? That would be easier for a db translation layer as compared to having to interpret the materialized SQL

derekperkins avatar Aug 08 '25 20:08 derekperkins