Lloyd
DTDrizzle Team
•Created by Lloyd on 6/11/2024 in #help
Top-level await in drizzle.config.ts
Is there a reason top-level
await
is only supported in migrate/studio commands and not generate/check, is this something that can be trivially added to drizzle-kit?
In my case I'm reading the secret asynchronously via AWS.
There's an open issue with a workaround posted, which does work, but is kind of gross: https://github.com/drizzle-team/drizzle-orm/issues/1982#issuecomment-211234084013 replies
DTDrizzle Team
•Created by Lloyd on 5/2/2024 in #help
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!3 replies