Become a Gold Sponsor
DrizzleORM v0.30.0 release
Mar 7, 2024

Breaking Changes

The Postgres timestamp mapping has been changed to align all drivers with the same behavior.

❗ We’ve modified the postgres.js driver instance to always return strings for dates, and then Drizzle will provide you with either strings of mapped dates, depending on the selected mode. The only issue you may encounter is that once you provide the `postgres.js“ driver instance inside Drizzle, the behavior of this object will change for dates, which will always be strings.

We’ve made this change as a minor release, just as a warning, that:

Parsers that were changed for postgres.js.

const transparentParser = (val: any) => val;

// Override postgres.js default date parsers: https://github.com/porsager/postgres/discussions/761
for (const type of ['1184', '1082', '1083', '1114']) {
	client.options.parsers[type as any] = transparentParser;
	client.options.serializers[type as any] = transparentParser;
}

Ideally, as is the case with almost all other drivers, we should have the possibility to mutate mappings on a per-query basis, which means that the driver client won’t be mutated. We will be reaching out to the creator of the postgres.js library to inquire about the possibility of specifying per-query mapping interceptors and making this flow even better for all users.

If we’ve overlooked this capability and it is already available with `postgres.js“, please ping us in our Discord!

A few more references for timestamps without and with timezones can be found in our docs

Check docs for getting started with postgres.js driver and Drizzle here

Fixes