cube
cube copied to clipboard
[DuckDB] Add support for duckdb connection via database file
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
+1 here's a PR that does it: https://github.com/luabase/cube/commit/37f56fe8833a6ee1836de2cd1bbdb4d44a96fbd0
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.
@JichaoS Could you please submit this as a PR to Cube's repository?
Created here https://github.com/cube-js/cube/pull/7799
Thanks for your contribution, @JichaoS 🙌