Skip to content
This repository was archived by the owner on Jul 1, 2026. It is now read-only.
This repository was archived by the owner on Jul 1, 2026. It is now read-only.

Unhandled null parameters #116

Description

@jooadam
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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions