prisma-generator-drizzle icon indicating copy to clipboard operation
prisma-generator-drizzle copied to clipboard

Postgres TimestampTZ is generated without withTimezone:true

Open Jaaneek opened this issue 2 years ago • 1 comments

When we have timestampTZ from postgres we should add withTimezone true to the drizzle schema. here is how it should look like: image

Description of drizzle timestamps image

Related tweet https://twitter.com/Jaaneek/status/1751655615271727251

Jaaneek avatar Feb 01 '24 12:02 Jaaneek

Prisma, by default, doesn't include timezone data for DateTime fields unless you use the @db modifier. Automatically enabling withTimezone might lead to unexpected behaviors for users not using this modifier.

Although it could be conditionally generated only for ones with @db.timestamptz, Prisma's DMMF helper doesn't give any information regarding the use of modifiers. I'm seeking a workaround for this limitation.

fdarian avatar Feb 01 '24 16:02 fdarian