Execute the prepared statement. This returns undefined
.
Symbol
Statement.run
@param params
optional values to bind to the statement. If omitted, the statement is run with the last bound values or no parameters if there are none.
const stmt = db.prepare("UPDATE foo SET bar = ?");
stmt.run("baz");
// => undefined
stmt.run();
// => undefined
stmt.run("foo");
// => undefined
The following types can be used when binding parameters:
JavaScript type | SQLite type |
---|---|
string | TEXT |
number | INTEGER or DECIMAL |
boolean | INTEGER (1 or 0) |
Uint8Array | BLOB |
Buffer | BLOB |
bigint | INTEGER |
null | NULL |
Referenced types
interface Changes
An object representing the changes made to the database since the last run
or exec
call.
- lastInsertRowid: number | bigint
If
safeIntegers
istrue
, this is abigint
. Otherwise, it is anumber
.