TIMESTAMPTZ is returned as string instead of Date object
It seems that drizzle upon initialization (re-)sets
pg-types
handling of dates. Usually pg-types
and thus node-postgres
converts TIMESTAMP
, TIMESTAMPTZ
and other related data base types automatically to a JS date object.
I tried Drizzle with the node-postgres driver and it didn't seem to work, dates were simply strings. I figured that Drizzle resets the default type convertes upon initialization (see picture).
I was wondering why that is. And is that simply a me problem or did anyone also find TIMESTAMP
being returned as string
when using node-postgres
?4 Replies
I don't know how your schema is defined but for the
timestamp
column you can define a mode that tells it if it should return a date or string like this:
oh nice
can I have that the default for drizzel-kit's introspect?
I don't think there's an option for it, unfortunately
oh that's a pity.
I find that there are not too many options after all.
thanks anyway