© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
6 replies
Hello, I’m Allie!

Why must batches be readonly?

Hi y'all!

I'm using
drizzle-orm
drizzle-orm
to insert a lot of rows. I want to avoid making too many trips to my database, so I've decided to batch some statements together. The trouble is, it appears that
db.batch
db.batch
requires the statements passed in to be within a read-only array, which means I cannot dynamically build the statements. Is there a specific reason why that is the case?

The underlying DB should be able to support dynamically-built arrays of statements.
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

New enum values must be committed before they can be used
Drizzle TeamDTDrizzle Team / help
2y ago
Running `drizzle-kit introspect:pg` returns "client password must be a string"
Drizzle TeamDTDrizzle Team / help
3y ago
TypeErr: BatchItem<sqlite>[] not assignable to readonly [BatchItem<sqlite>, ...BatchItem<sqlite>[]]
Drizzle TeamDTDrizzle Team / help
2y ago