Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MySQLConnection

An interface which represents a connection to MySQL server.

The connection object supports all the operations defined in the interface, in addition it provides MySQL utility command support:

  • COM_PING
  • COM_CHANGE_USER
  • COM_RESET_CONNECTION
  • COM_DEBUG
  • COM_INIT_DB
  • COM_STATISTICS
  • COM_SET_OPTION

Hierarchy

  • any
    • MySQLConnection

Index

Methods

changeUser

  • Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.

    Parameters

    Returns PromiseLike<void>

  • Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.

    Parameters

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

    Returns MySQLConnection

closeHandler

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

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

    Returns MySQLConnection

debug

  • debug(): PromiseLike<void>
  • debug(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): MySQLConnection
  • Send a DEBUG command to dump debug information to the server's stdout.

    Returns PromiseLike<void>

  • Send a DEBUG command to dump debug information to the server's stdout.

    Parameters

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

    Returns MySQLConnection

exceptionHandler

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

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

    Returns MySQLConnection

getInternalStatistics

  • getInternalStatistics(): PromiseLike<string>
  • getInternalStatistics(handler: ((res: AsyncResult<string>) => void) | Handler<AsyncResult<string>>): MySQLConnection
  • Send a STATISTICS command to get a human readable string of the server internal status.

    Returns PromiseLike<string>

  • Send a STATISTICS command to get a human readable string of the server internal status.

    Parameters

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

    Returns MySQLConnection

ping

  • ping(): PromiseLike<void>
  • ping(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): MySQLConnection
  • Send a PING command to check if the server is alive.

    Returns PromiseLike<void>

  • Send a PING command to check if the server is alive.

    Parameters

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

    Returns MySQLConnection

prepare

  • prepare(sql: string): PromiseLike<PreparedStatement>
  • prepare(sql: string, handler: ((res: AsyncResult<PreparedStatement>) => void) | Handler<AsyncResult<PreparedStatement>>): MySQLConnection
  • Parameters

    • sql: string

    Returns PromiseLike<PreparedStatement>

  • Parameters

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

    Returns MySQLConnection

resetConnection

  • resetConnection(): PromiseLike<void>
  • resetConnection(handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): MySQLConnection
  • Send a RESET_CONNECTION command to reset the session state.

    Returns PromiseLike<void>

  • Send a RESET_CONNECTION command to reset the session state.

    Parameters

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

    Returns MySQLConnection

setOption

  • Send a SET_OPTION command to set options for the current connection.

    Parameters

    Returns PromiseLike<void>

  • Send a SET_OPTION command to set options for the current connection.

    Parameters

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

    Returns MySQLConnection

specifySchema

  • specifySchema(schemaName: string): PromiseLike<void>
  • specifySchema(schemaName: string, handler: ((res: AsyncResult<void>) => void) | Handler<AsyncResult<void>>): MySQLConnection
  • Send a INIT_DB command to change the default schema of the connection.

    Parameters

    • schemaName: string

    Returns PromiseLike<void>

  • Send a INIT_DB command to change the default schema of the connection.

    Parameters

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

    Returns MySQLConnection

Static cast

  • Cast a to MySQLConnection.

    This is mostly useful for Vert.x generated APIs like RxJava/Mutiny.

    Parameters

    • sqlConnection: SqlConnection

    Returns MySQLConnection

Static connect

  • Create a connection to MySQL server with the given connectOptions.

    Parameters

    Returns PromiseLike<MySQLConnection>

  • Create a connection to MySQL server with the given connectOptions.

    Parameters

    Returns void

  • Like {@link MySQLConnection#connect} with options built from connectionUri.

    Parameters

    • vertx: Vertx
    • connectionUri: string

    Returns PromiseLike<MySQLConnection>

  • Like {@link MySQLConnection#connect} with options built from connectionUri.

    Parameters

    Returns void

Generated using TypeDoc