WiseLibs / better-sqlite3

The fastest and simplest library for SQLite3 in Node.js.
MIT License
5.26k stars 391 forks source link

The "IN (?)" statement with an array produces a "Too many parameter values" error #1109

Closed Filyus closed 8 months ago

Filyus commented 8 months ago

Maybe this is TypeORM related, it produces a such query without commas:

SELECT * FROM table WHERE field IN (?)

The parameter is an array with many items. The following error is produced: RangeError: Too many parameter values were provided

But this syntax works with an usual sqlite.

UPDATE: This happens when passed not [1, 2, 3], but [[1, 2, 3]] as a parameter, so this is more a my mistake.