Large inserts throw `RangeError: Maximum call stack size exceeded`
In several cases I've noticed that with inserts of ~4k rows I get this
By breaking my inserted data into chunks of ~2k rows each, I can do inserts without this bug. This suggests to me that my application code is not at fault.
I'm using Planetscale/MySQL, but I don't think it has to do with the database connection - even using
Here are other instances where Drizzle users got this error:

RangeError: Maximum call stack size exceeded error. Note that I am using .onDuplicateKeyUpdate (i.e. they are upserts).By breaking my inserted data into chunks of ~2k rows each, I can do inserts without this bug. This suggests to me that my application code is not at fault.
I'm using Planetscale/MySQL, but I don't think it has to do with the database connection - even using
const query = db.insert(...).values(...) and then console.log(query.toSQL()), which normally works, gives the same error when there are this many rows. My guess is that the SQL builder is the culprit (maybe some O(n^2) recursion somewhere).Here are other instances where Drizzle users got this error:
- https://www.answeroverflow.com/m/1092908217983578184
- https://www.answeroverflow.com/m/1103370708672851978
- and here is a similar issue from another library (Prisma with
createMany) for good measure: https://github.com/prisma/prisma/issues/9196
Weird bug where whenever I add a
where eq clause getting maximum call stack exceededHi,
I am getting
I am using
I have a page to add an organization with the following action:
```typescript
export const action = async ({ request, context ...
I am getting
RangeError: Maximum call stack size exceeded when I try to INSERT something in the DB, SELECT queries works with no issues.I am using
"drizzle-orm": "^0.25.3" and "@remix-run/react": "^1.15.0".I have a page to add an organization with the following action:
```typescript
export const action = async ({ request, context ...
GitHub
Bug description Calls to prisma.<model>.createMany are behaving unexpectedly when provided a sufficient number of records that are missing a required field. For ~20k records, the call seems t...