For a few hours I am trying to debug a non trivial problem
D1_ERROR: too many SQL variables
I found that generation of kysely-d1 is using the rest operator .bind(...data) therefore from
array of objects i get one single array which is flat.
From this point D1 will fail because I have suddenly 100+ params
https://github.com/aidenwallis/kysely-d1/blob/ba48112890fd91035fb51b93dc1301e9f8e4329d/src/index.ts#L104
Context
For a few hours I am trying to debug a non trivial problem
I found that generation of
kysely-d1
is using the rest operator.bind(...data)
therefore from array of objects i get one single array which is flat. From this point D1 will fail because I have suddenly100+
paramsTo reproduce
create a big table
try to do a insert with 10 items Which produces sql like this
and params will be
To fix
Most possible adapt
https://developers.cloudflare.com/d1/platform/client-api/#batch-statements
?