cube icon indicating copy to clipboard operation
cube copied to clipboard

[DuckDB] Add support for duckdb connection via database file

Open tehunter opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I am working with cube in a local docker environment. I'd like to use duckdb as my database engine, but there is only support for using duckdb :memory: connections against an S3 endpoint. In my setup, I have connected duckdb to a local database file.

Describe the solution you'd like Add an environment variable like CUBEJS_DB_DUCKDB_CONNECTION which could take the value of :memory:, a string to a database file connection, or other type of connection (e.g., md:).

Describe alternatives you've considered I've tried using PostgreSQL over duckdb, but the performance and features were lacking as PostgreSQL isn't optimized as an analytics database.

Additional context Here are the relevant lines: https://github.com/cube-js/cube/blob/377260653026401b36aab45f0dad9ec93e0c524d/packages/cubejs-duckdb-driver/src/DuckDBDriver.ts#L58-L63

tehunter avatar Jan 12 '24 16:01 tehunter

+1 here's a PR that does it: https://github.com/luabase/cube/commit/37f56fe8833a6ee1836de2cd1bbdb4d44a96fbd0

JichaoS avatar Jan 17 '24 07:01 JichaoS

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

github-actions[bot] avatar Jan 18 '24 04:01 github-actions[bot]

@JichaoS Could you please submit this as a PR to Cube's repository?

igorlukanin avatar Feb 20 '24 13:02 igorlukanin

Created here https://github.com/cube-js/cube/pull/7799

JichaoS avatar Feb 22 '24 05:02 JichaoS

Thanks for your contribution, @JichaoS 🙌

igorlukanin avatar Mar 20 '24 22:03 igorlukanin