© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago
Wyzp

How to use custom date (1082) type parser in postgres.js for >0.30.0?

I have the following parser when creating the connection, to parse postgres date from string to JS Date.

        types: {
          date: {
            to: 1082,
            from: [1082],
            serialize: (x: any) => x,
            parse: (x: any) => new Date(`${x} 00:00:00`),
          },
        },
        types: {
          date: {
            to: 1082,
            from: [1082],
            serialize: (x: any) => x,
            parse: (x: any) => new Date(`${x} 00:00:00`),
          },
        },


It works in 0.29.5 (I know there's a breaking change in 0.30.0), but Is there a way to update and still have the custom parser working?
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Postgres.js type error string/date
Drizzle TeamDTDrizzle Team / help
2y ago
New string mode date handling for postgres in 0.30.0 is potentially inconsistent
Drizzle TeamDTDrizzle Team / help
2y ago
Type error working with Postgres dates in v.0.30.1
Drizzle TeamDTDrizzle Team / help
2y ago
Converting drizzle custom type to Postgres composite type fails for arrays
Drizzle TeamDTDrizzle Team / help
3y ago