Replies: 1 comment
-
Alright, I just found this issue, which seems to be my exact problem, but it seems like the only PRs attempting to fix the issue have either been closed or have been open for months. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone!
I'm using drizzle as my ORM and have a table with a couple of timestamp fields. When using prepared queries to insert, I'm met with the error
TypeError: value.toISOString is not a function at PgTimestamp.mapToDriverValue
.Here's a minimal example for reference:
Using a normal insert works as expected:
I added a log to the
mapToDriverValue
method to check the type and value and I can see that it tries to map the placeholder object itself to an ISOString which obviously fails.Setting the timestamp mode to string works, since it skips the mapping, but I would rather use date mode for convenience.
I am not experienced with drizzle so I'm unsure if this is a bug or whether I am using prepared queries incorrectly. How can I write this as a working prepared query?
Beta Was this translation helpful? Give feedback.
All reactions