14 Replies
I think they have a toSQL function on them.
Basically call .toSQL() at the end of the query.
Sadly, they don't.
There is a hack though:
Hmmm, anyway to mock the connection to the database?
That would be not recommended.
What I do is writing my queries in a user.repository.ts and importing this in my user.service.ts (where my business rules are).
I now can mock my repository file.
To test my repository file, I write integrations tests on a real db.
We will have it in next releases
I've just added it so support batch api for libsql
I'll do the same for postgres and mysql
any update on D1 batch ?
I'm preparing libsql batch api after that will send a notes to a PR with D1, so it can be changed in a same way as libsql
Have you noticed that the toSQL() does not generated the column renames like it shows in the docs
yes, it was a showcase of equivalent query to get same names
drizzle get's just an array of arrays and map all of them itself
Gotcha, I noticed that mapping happened on the Drizzle side. Is this something that the team would consider changing in the future?
changing docs? or changing runtime mapping?
Neither. Changing the toSql() to include the column renames
is it needed?
I can see some use cases for it. Though I personally do not probably need it at this moment