Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thin mode: detect timezone #144

Closed
BayerSe opened this issue Feb 13, 2023 · 4 comments
Closed

thin mode: detect timezone #144

BayerSe opened this issue Feb 13, 2023 · 4 comments
Labels
enhancement New feature or request patch available

Comments

@BayerSe
Copy link

BayerSe commented Feb 13, 2023

The thin and the thick mode drivers behave differently with respect to timezones: thin uses UTC, whereas thick detects the local timezone. This is confusing for people migrating from cx_Oracle to the new thin driver, see e.g. #140.

It would be great if the thin mode driver would detect the local time zone, too, so that the following script always returns the same value, independent of the thick flag.

import oracledb

user ="..."
password = "..."
dsn = "..."

thick = False

if thick:
    oracledb.init_oracle_client()

with oracledb.connect(user=user, password=password, dsn=dsn) as connection:
    with connection.cursor() as cursor:
        tz = cursor.execute("SELECT SESSIONTIMEZONE FROM DUAL").fetchone()[0]

print(f"Timezone: {tz}")
@BayerSe BayerSe added the enhancement New feature or request label Feb 13, 2023
@anthony-tuininga
Copy link
Member

This is on our (long) list of things to do. I'll let @cjbj comment on priority!

anthony-tuininga added a commit that referenced this issue Mar 29, 2023
@anthony-tuininga
Copy link
Member

Ok. I had a chance to address this. I have pushed a patch that should correct this issue. If you are able to build from source you can verify that it corrects your issue as well.

@anthony-tuininga
Copy link
Member

This has been included in version 1.3.0 which was just released.

@BayerSe
Copy link
Author

BayerSe commented Apr 3, 2023

Hi @anthony-tuininga; sorry for replying only now. I've tested it, and it works perfectly. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request patch available
Projects
None yet
Development

No branches or pull requests

2 participants