Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

PreparedStatement

import { PreparedStatement } from "https://raw.githubusercontent.com/jeremyBanks/database/0.1.0-dev/sql/sql.ts";
class PreparedStatement<Meta extends driver.MetaBase> {
constructor(
driverConnection: driver.Connection<Meta>,
driverTransaction: driver.Transaction<Meta> | undefined,
operationLock: Mutex<Record<never, never>>,
sqlString: string,
context: Context,
);
private contextCloser: () => void;
readonly context: Context;
 
async dispose(): Promise<void>;
async exec(args?: Array<Meta["BoundValue"]>): Promise<ResultChanges<Meta>>;
async query(args?: Array<Meta["BoundValue"]>): Promise<ResultRows<Meta>>;
async queryRow(args?: Array<Meta["BoundValue"]>): Promise<Array<Meta["ResultValue"]> | undefined>;
}

§Type Parameters

§Constructors

§
new PreparedStatement(driverConnection: driver.Connection<Meta>, driverTransaction: driver.Transaction<Meta> | undefined, operationLock: Mutex<Record<never, never>>, sqlString: string, context: Context)
[src]

§Properties

§
contextCloser: () => void
[src]

§Methods

§
dispose(): Promise<void>
[src]

Disposes of this object so that any associated resources can be freed.

Calling dispose multiple times is allowed, but calling any other method after calling dispose will cause a TypeError.

Will not typically throw.

§
exec(args?: Array<Meta["BoundValue"]>): Promise<ResultChanges<Meta>>
[src]

Executes the query with an optional array of bound values, without returning any result rows. A insertedRowId and affectedRows value may be returned, but note that for some drivers these values may reflect a previous query if the executed one did not actually insert or affect any rows. (These should only be absent if the driver is certain that they're not relevant to the executed query, or doesn't support them at all.)

May throw DatabaseConnectivityError or DatabaseEngineError.

§
query(args?: Array<Meta["BoundValue"]>): Promise<ResultRows<Meta>>
[src]

Executes the query with an optional array of bound values, and incrementally reads rows from the database. The iterators should be disposed of by calling .return() (which a for/for await statement will do automatically) to release associated resources, or they may hold their associated transactions/connections open.

May throw DatabaseConnectivityError or DatabaseEngineError.

§
queryRow(args?: Array<Meta["BoundValue"]>): Promise<Array<Meta["ResultValue"]> | undefined>
[src]

Executes the query with an optional array of bound values, returning only the first row of results, as an array.

May throw DatabaseConnectivityError or DatabaseEngineError.