interface
SQL.SQLiteOptions
interface SQLiteOptions
Options for Database
- readonly?: boolean
Open the database as read-only (no write operations, no create).
Equivalent to constants.SQLITE_OPEN_READONLY
- safeIntegers?: boolean
When
true, integers are returned asbigint.When
false, integers are returned asnumberand truncated to 52 bits. - strict?: boolean
When set to
falseorundefined:- Queries missing bound parameters do NOT throw an error
- Bound named parameters in JavaScript need to exactly match the SQL query.
const db = new Database(":memory:", { strict: false }); db.run("INSERT INTO foo (name) VALUES ($name)", { $name: "foo" });When set to
true:- Queries missing bound parameters throw an error
- Bound named parameters in JavaScript no longer need the
$,:, or@prefix. The SQL query keeps its prefix.