db.batch is missing
Hello, so i am trying to send 2 db queries at once to reduce latency by reducing round trips to from the server to the db and for some reason the batch property is missing.
I am using the latest version of drizzle as seen in my package.json.
I have tried restarting my ts server and restarting my vscode but no luck.
I am trying to follow the docs online but have no clue what else to try. Any help would be greatly appreciated, thankyou.
7 Replies
what driver are you using?
@Andrew Sherman I am using the pg driver:
good, as docs mention: https://orm.drizzle.team/docs/batch-api
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
you can use batch only for libsql and d1
which are both sqlite over http
Postgres doesn't have batch api itself. But you can use Promise.all if you want to run queries in parallel
Ohhh ok fair enough. Will this feature eventually be available for postgres. Also are there any differences / downsides for using Promise.all over db.batch. Sorry if this is a noobish question.