Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Update

A Query that represents an UPDATE.

Hierarchy

Index

Constructors

constructor

  • Initialize the query using a From instance.

    Parameters

    • executer: Executer

      An Executer instance that matches the database type (e.g. MySQLExecuter).

    • 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 Update

Properties

Protected executer

executer: Executer

An Executer instance that matches the database type (e.g. MySQLExecuter).

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).

Abstract toString

  • toString(): string

Generated using TypeDoc