Postgres.js type error string/date
I'm running the following where clause in a select query:
When printing out the query with parameters, the value for endingAfter is a Date, and has not been turned into a string:
...with the error:
This works fine when I perform
.toISOString()
on endingAfter
, but it doesn't seem to do that automatically in this case, I assume because it doesn't have the column information because the first arguments is an SQL<unknown>.
I've tried various things to get this right; using a type parameter for the sql, using .mapWith()
with a timestamp column, but haven't managed to come up with the correct magic.
I've noted the postgres-js breaking changes in 0.3 around strings/Dates, which is why I have just used .toISOString() for now, but this feels like it should work because it works in the other examples where there is column information present
Thanks!2 Replies