Open webfrank opened 3 years ago
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.
Hi, I will try to create the new driver for CrateDB, I got another issue inside BaseDriver which tries to create a new schema but on CrateDB this is not necessary so it should be override inside the driver.
Hello @webfrank ,
Looks like it's better to do a new driver, and there is a good example:
https://github.com/cube-js/cube.js/tree/master/packages/cubejs-redshift-driver
Redshift driver is based on top of PostgreSQL driver. You should use the same approach for the CrateDB driver, and you will be able to override prepareConnection
.
Why is it better to do a new driver instead of hacking Postgres driver?
Thanks
@webfrank i had write one cratedb driver you can try it https://github.com/rongfengliang/cubejs-cratedb-driver
Describe the bug I'm using CrateDB with Postgres wire protocol. I've found the current implementation of
prepareConnection
inside PostgresDriver uses this line:await conn.query(
SET TIME ZONE '${this.config.storeTimezone || 'UTC'}');
which for sure works for Postgres but not with compatible ones which needs this one:await conn.query(
SET TIMEZONE = '${this.config.storeTimezone || 'UTC'}');
This latest syntax also works on Postgres and it seems the standard one (from my research).
I propose to just change this line or create a new driver, CrateDBDriver, copy of PostgresDriver with only this line changed.
To Reproduce Steps to reproduce the behavior:
Expected behavior As CrateDB uses Postgres wire protocol and high compatibility for syntax it should work out of the box
Version: 0.28.52