Skip to content

Timezone as text #2842

Closed Answered by simolus3
BananaMasterz asked this question in Q&A
Jan 17, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Drift's dateTime() column can't be used with postgres dates - it always expects a text/int column because that's all we get with sqlite3.

With postgres, you can use

  TimestampColumn get myDate => customType(PgTypes.timestampNoTimezone)();

In the next version, PgTypes.timestampWithTimezone will be available as well. But as long as you're connecting to an existing database (that is, you're not letting drift emit the CREATE TABLE statements), the two time types are identical.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BananaMasterz
Comment options

Answer selected by BananaMasterz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants