You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varsqlite=require('sqlite3').verbose();vardb=newsqlite.Database('test.db');db.all('SELECT * FROM test',null,function(error,rows){if(error){console.log(error);}else{rows.forEach(function(row){console.log(row);});}});db.close();
The previous code will produce the following output:
{ [Error: SQLITE_RANGE: bind or column index out of range] errno: 25, code: 'SQLITE_RANGE' }
Changing the second argument of Database#all() from null to [] produces the desired output.
This handling of null values is both counterintuitive and undocumented. Other methods may be affected too.
The previous code will produce the following output:
Changing the second argument of
Database#all()fromnullto[]produces the desired output.This handling of null values is both counterintuitive and undocumented. Other methods may be affected too.