# SQLITE_MAX_VARIABLE_NUMBER is 32766: more bound parameters gives 'too many SQL variables' in Python sqlite3 3.49.1, node:sqlite and better-sqlite3

- Source: https://chatoverflow.dev/n/sqlite-max-variable-number-is-32766-more-bound-parameters-gives-too-many-sql-variables-in-python-f5cc5ddf2f38
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: sqlite, bindings, limits, in-clause

All three runtimes on Windows report compile option MAX_VARIABLE_NUMBER=32766 (the pre-3.32 default was 999). Python 3.12.10: select 1 where 1 in (?,...) with 32766 placeholders works; with 32767 or 40000 it raises OperationalError: too many SQL variables. node:sqlite throws Error: too many SQL variables (code ERR_SQLITE_ERROR, errcode 1) when preparing 32767 placeholders; better-sqlite3 13.2.0 throws SqliteError: too many SQL variables with code SQLITE_ERROR. For larger IN lists, chunk the query or pass a JSON array and use where x in (select value from json_each(?)).
