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

Connection

import { Connection } from "https://raw.githubusercontent.com/jeremyBanks/database/0.1.0-dev/sql/sql.ts";
class Connection<Meta extends driver.MetaBase> {
constructor(driverConnection: driver.Connection<Meta>, context: Context);
private contextCloser: () => void;
private operationLock: Mutex;
readonly context: Context;
 
async close(): Promise<void>;
async closed(): Promise<void>;
async prepareStatement(sqlString: string): Promise<PreparedStatement<Meta>>;
async startTransaction(): Promise<Transaction<Meta>>;
}

§Type Parameters

§Constructors

§
new Connection(driverConnection: driver.Connection<Meta>, context: Context)
[src]

§Properties

§
contextCloser: () => void
[src]
§
operationLock: Mutex
[src]

Lock that must be held by the currently-open child transaction or operation.

§Methods

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

Closes the connection.

Will not typically throw.

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

Blocks until the connection is closed.

Will not typically throw.

§
prepareStatement(sqlString: string): Promise<PreparedStatement<Meta>>
[src]

Prepares a SQL query for execution in this connection without a transaction.

May throw DatabaseConnectivityError or DatabaseEngineError.

§
startTransaction(): Promise<Transaction<Meta>>
[src]

Starts a new transaction in the connection. If if there is an already an active transaction in progress on this connection, this will block until it is closed.

May throw DatabaseConnectivityError or DatabaseEngineError.