Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SqlConnection

A connection to the database server.

Hierarchy

Index

Methods

begin

  • Begin a transaction and returns a Transaction for controlling and tracking this transaction.

    When the connection is explicitely closed, any inflight transaction is rollbacked.

    Returns PromiseLike<Transaction>

  • Begin a transaction and returns a Transaction for controlling and tracking this transaction.

    When the connection is explicitely closed, any inflight transaction is rollbacked.

    Parameters

    Returns void

close

  • close(): PromiseLike<void>
  • close(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): void
  • Close the current connection after all the pending commands have been processed.

    Returns PromiseLike<void>

  • Close the current connection after all the pending commands have been processed.

    Parameters

    • handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>

    Returns void

closeHandler

  • closeHandler(handler: ((res: void) => void) | Handler<void>): SqlConnection
  • Set an handler called when the connection is closed.

    Parameters

    • handler: ((res: void) => void) | Handler<void>

    Returns SqlConnection

databaseMetadata

  • Returns DatabaseMetadata

exceptionHandler

  • exceptionHandler(handler: ((res: Throwable) => void) | Handler<Throwable>): SqlConnection
  • Set an handler called with connection errors.

    Parameters

    • handler: ((res: Throwable) => void) | Handler<Throwable>

    Returns SqlConnection

isSSL

  • isSSL(): boolean
  • Returns boolean

prepare

  • Create a prepared statement using the given sql string.

    Parameters

    • sql: string

    Returns PromiseLike<PreparedStatement>

  • Create a prepared statement using the given sql string.

    Parameters

    Returns SqlConnection

  • Create a prepared statement using the given sql string.

    Parameters

    Returns PromiseLike<PreparedStatement>

  • Create a prepared statement using the given sql string.

    Parameters

    Returns SqlConnection

preparedQuery

  • Create a prepared query, one of the {@link Query#execute} or {@link PreparedQuery#executeBatch} methods must be called to execute the query.

    Parameters

    • sql: string

    Returns PreparedQuery<RowSet<Row>>

  • Create a prepared query, one of the {@link Query#execute} or {@link PreparedQuery#executeBatch} methods must be called to execute the query.

    Parameters

    Returns PreparedQuery<RowSet<Row>>

query

  • Create a query, the {@link Query#execute} method must be called to execute the query.

    Parameters

    • sql: string

    Returns Query<RowSet<Row>>

transaction

  • Returns Transaction

Generated using TypeDoc