© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
7 replies
ffraenz

On inserting many, many rows

In the documentation, the following insert with multiple rows is described:

await db.insert(users).values([{ name: 'Andrew' }, { name: 'Dan' }]);
await db.insert(users).values([{ name: 'Andrew' }, { name: 'Dan' }]);


In a project of mine, an insert query grew to 10k rows to be inserted at once. So, I was wondering, if it is good practice to throw this whole thing at the insert query or if I am responsible to batch the inserts to smaller more reasonable chunks? I am using Postgres. Thank you for any hint on this topic.
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

inserting many-to-many relationship correctly?
Drizzle TeamDTDrizzle Team / help
2y ago
Update many rows
Drizzle TeamDTDrizzle Team / help
4mo ago
How to fetch related table rows in many_to_many
Drizzle TeamDTDrizzle Team / help
3y ago
How to insert many rows with one-to-many relationships
Drizzle TeamDTDrizzle Team / help
3y ago