Skip to main content
method PreparedQuery.prototype.execute
import { PreparedQuery } from "";

Binds the given parameters to the query and executes the query, ignoring any rows which might be returned.

Using this method is more efficient when the rows returned by a query are not needed or the query does not return any rows.


const query = db.prepareQuery<never, never, [string]>("INSERT INTO people (name) VALUES (?)");
const query = db.prepareQuery<never, never, { name: string }>("INSERT INTO people (name) VALUES (:name)");
query.execute({ name: "Peter" });

See QueryParameterSet for documentation on how values can be bound to SQL statements.

See QueryParameter for documentation on how values are returned from the database.


params: P