New string mode date handling for postgres in 0.30.0 is potentially inconsistent
When selecting a value from a column of type
timestamp with time zone
, I receive the following string format: 2024-01-19 16:54:36.74526+00
When selecting a value from a column of type date
, I receive the following string format: 1990-01-01T00:00:00.000Z
It appears the serialization changes for the postgres driver may not be working - the ones here https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/postgres-js/driver.ts#L27
If I define my own custom type as:
in the postgres-js options, then suddenly I receive the raw sql values I expect: 1990-01-01
GitHub
drizzle-orm/drizzle-orm/src/postgres-js/driver.ts at main · drizzle...
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅 - drizzle-team/drizzle-orm
1 Reply
oh weird, I restarted my server and now the date handling is working. For some reason the live reloads on changing postgres-js options took effect, but the drizzle changes to the serialization did not.