cube-js / cube-js/cube

Postgres Driver SET TIMEZONE

Open
#3,633 4 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**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:
1. Connect to a CrateDB Instance
2. Try to open Schema from playground
3. See error

**Expected behavior**
As CrateDB uses Postgres wire protocol and high compatibility for syntax it should work out of the box

**Version:**
0.28.52

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.