import { Database } from "https://deno.land/x/sqlite3@0.4.4/mod.ts";
Simply executes the SQL, without returning anything.
Example:
// Create table
db.execute("create table users (id integer not null, username varchar(20) not null)");
// Inserts
db.execute("insert into users (id, username) values(?, ?)", id, username);
// Or run SQL safely using Template Strings!
db.execute`insert into users (id, username) values(${id}, ${username})`;
// Insert with named parameters
db.execute("insert into users (id, username) values(:id, :username)", { id, username });
// Pragma statements
db.execute("pragma journal_mode = WAL");
db.execute("pragma synchronous = normal");
db.execute("pragma temp_store = memory");
Under the hood, it uses sqlite3_exec
if no parameters are given to bind
with the SQL statement, a prepared statement otherwise.
Parameters
...args: BindValue[]
Parameters
...args: BindValue[]
Parameters
args: Record<string, BindValue>