resolve SQLITE_MAX_VARIABLE_NUMBER problem
python3 -m venv ./venv
source ./venv/bin/activate
pip install sqlalchemy
3.32.0 SQLITE_MAX_VARIABLE_NUMBER defaults to 32766, the version less than this is 999.
check version
sqlite3 -version
> 3.28.0 2019-04-15 14:49:49 378230ae7f4b721c8b8d83c8ceb891449685cd23b1702a57841f1be40b5daapl
sqlite3 test.db
> create table user (id integer primary key autoincrement, name text);
- Solution1:
Query.filter(text("table.col in (1,2,3,4 ....)"))
- Solution2: sqlalchemy >= 1.4 bindparam() with literal_execute=True
Query.filter(Table.Column.in_(bindparam("xxx", range(300000), literal_execute=True)))