You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to use time-related queries with drizzle-kit, I encounter an error. Specifically, the error occurs when trying to fetch records from the visits table where the createdAt timestamp is greater than or equal to the current time.
I suspect there is some epoch time vs JS date type issue. .$onUpdate(() => new Date()) works and so does setting it when updating with updatedDate: sql(unixepoch())``. It is just odd that it doesn't work in the schema onUpdate function.
@magicalpuffin I've got the same issue. I was happy to see that they added onUpdate but after refactoring to take advantage of it, I realized it didn't work on timestamps so I'm back to manually pushing updateOn values until it gets fixed.
I also don't want a text column, because it's a timestamp, not text.
What version of
drizzle-orm
are you using?0.30.10
What version of
drizzle-kit
are you using?0.21.2
Describe the Bug
Bug Report: Error when using time-related queries
Description
When attempting to use time-related queries with
drizzle-kit
, I encounter an error. Specifically, the error occurs when trying to fetch records from thevisits
table where thecreatedAt
timestamp is greater than or equal to the current time.Code Snippets
Here is the code that produces the error:
Schema definition for the
visits
table:Error Message
Expected behavior
No response
Environment & setup
No response
The text was updated successfully, but these errors were encountered: