Closed
Description
var sqlite = require('sqlite3').verbose();
var db = new sqlite.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.
Metadata
Metadata
Assignees
Labels
No labels