Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MySQLUpdate

A Query that represents an UPDATE for a MySQL database.

Hierarchy

Index

Constructors

constructor

  • Initialize the query using a From instance.

    Parameters

    • escaper: MySQLEscaper

      An Escaper for MySQL. Used when escaping column names.

    • executer: MySQLExecuter

      An Executer instance for MySQL.

    • from: From

      A From instance which holds the base table, all joined-in tables, and the where clause.

    • model: UpdateType

      An object containing key-value pairs. Each key must correspond to a fully-qualified property (<table-alias>.<property>), and each associated value is the value to update in the database.

    Returns MySQLUpdate

Properties

Protected escaper

escaper: MySQLEscaper

An Escaper for MySQL. Used when escaping column names.

Protected executer

executer: MySQLExecuter

An Executer instance for MySQL.

Protected from

from: From

A From instance which holds the base table, all joined-in tables, and the where clause.

Protected model

model: UpdateType

An object containing key-value pairs. Each key must correspond to a fully-qualified property (<table-alias>.<property>), and each associated value is the value to update in the database.

Protected paramList

paramList: ParameterList

Protected paramLookup

paramLookup: Map<string, string>

Protected updateCols

updateCols: FromColumnMeta[]

Methods

buildQuery

execute

  • Execute the query.

    Returns Promise<MutateResultType>

    A promise that shall be resolved with an object containing an "affectedRows" property. If an error occurs when executing the query, the returned promise shall be rejected with the error (unmodified).

toString

  • toString(): string

Generated using TypeDoc