Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Executer

An Executer executes database queries.

Hierarchy

  • Executer

Implemented by

Index

Methods

delete

  • Execute a delete query.

    Parameters

    • query: string

      The SQL to execute.

    • params: ParameterType

      An object containing query parameters for the query. Each parameter will be preceded with a colon in query.

    Returns Promise<MutateResultType>

    An object that has an affectedRows property indicating the number of rows affected (changed) by the query.

insert

  • Execute an insert query.

    Parameters

    • query: string

      The SQL to execute.

    • params: ParameterType

      An object containing query parameters for the query. Each parameter will be preceded with a colon in query.

    Returns Promise<InsertResultType>

    A promise that will be resolved with an object describing the result of the insert. An insertId should be present on the object if available (e.g. if the insert inolved a generated column).

query

  • Execute a raw query.

    Parameters

    • query: string

      The SQL to execute.

    • params: ParameterType

      An object containing query parameters for the query. Each parameter will be preceded with a colon in query.

    Returns Promise<any>

    A promise that shall be resolved if the query succeeds, or rejected otherwise.

select

  • Execute a select query.

    Parameters

    • query: string

      The SQL to execute.

    • params: ParameterType

      An object containing query parameters for the query. Each parameter will be preceded with a colon in query.

    Returns Promise<SelectResultType>

    A promise that is resolved with an array of query rows. Each row should have key-value pairs, where the keys are the selected columns.

update

  • Execute an update query.

    Parameters

    • query: string

      The SQL to execute.

    • params: ParameterType

      An object containing query parameters for the query. Each parameter will be preceded with a colon in query.

    Returns Promise<MutateResultType>

    An object that has an affectedRows property indicating the number of rows affected (changed) by the query.

Generated using TypeDoc