Issues with timestamp precision with postgres
Hi, I posted the other day about a bug with the
date
, but it seems this issue runs deeper.
https://discord.com/channels/1043890932593987624/1043890932593987627/1136224592764080268
I am also using timestamp
which has a similar issue, when using mode string
drizzle is returning a Date
instance (conflicting with the generated types)
To make matters worse, when using mode: 'date'
we lose all millisecond precision
This is the column I am defining
This maintains the precision, but then the types are incorrect.
Has anyone faced this issue? Is this is a bug in drizzle?6 Replies
Hi @pandareaper
Did you solve your problem?
Yeah I ended up creating a customType to address this. I saw a post yesterday suggesting it might have just been fixed though
I'm getting this error because my current data type is
timestamp(3)
but new type is timestamp (3)
- there is space between timestamp and precision.
Can you please share the migration data of timestamp so that I can refer it?This is my custom timestamp data type
Looking at my migrations I don't see any space, I can't see how drizzle would introduce that either. Have you put that space there in your
datatType()
?
And I didn't put the space to my type.
This is my sql file that was generated after introspecting the database.
Could you please share these files?