zach_e_s
zach_e_s
DTDrizzle Team
Created by zach_e_s on 5/31/2024 in #help
Large inserts throw `RangeError: Maximum call stack size exceeded`
I think at the very least, a more informative error message should be given when this happens. Also if the reason is understood and unavoidable maybe a warning with inserts of more than a certain size would be useful. Maybe a utility from Drizzle to break inserted data into chunks, I use this:
function getChunksOfSizeN<T>(arr: T[], n: number): T[][] {
return Array.from({ length: Math.ceil(arr.length / n) }, (_, i) =>
arr.slice(i * n, i * n + n)
)
}
function getChunksOfSizeN<T>(arr: T[], n: number): T[][] {
return Array.from({ length: Math.ceil(arr.length / n) }, (_, i) =>
arr.slice(i * n, i * n + n)
)
}
2 replies