property

sqlite.DatabaseOptions.strict

strict?: boolean

When set to true, a query with a missing bound parameter throws an error. When set to false or undefined, the parameter is NULL.

In both modes, the key of a named parameter can include the $, :, or @ prefix or leave it out. If an object has both keys, the key without the prefix wins in strict mode, and the key with the prefix otherwise.

const db = new Database(":memory:", { strict: true });
db.run("INSERT INTO foo (name) VALUES ($name)", { name: "foo" });
db.run("INSERT INTO foo (name) VALUES ($name)", { nmae: "foo" }); // throws