1,400 rows broke my D1 batch — here's why 7 statements beat 1,400 (opens in new tab)
A burst payload of 1,400 event rows turned a working D1 worker into a 3am Slack alert. The error wasn't even what I expected. The message from wrangler tail said D1_ERROR: too many SQL variables — not "too many statements." That distinction matters. When you use individual prepared statements with bound parameters, you're burning two counts simultaneously: the 1,000-statement batch ceiling and SQLite's 32,766-variable-per-statement cap. Hit either one and the whole batch dies. Most debugging ...
Read the original article