Class: Update

Update

A Query that represents an UPDATE.

Constructor

new Update(from, model)

Initialize the Query.
Parameters:
Name Type Description
from From A From instance.
model Object An object containing key-value pairs. Each key must correspond to a fully-qualified column name, as created by the Column.createFQColName() method (<table-alias>.<column-name>), and each associated value is the value to update in the database.
Source:

Extends

Members

database

Properties:
Name Type Description
database Database A database instance.
escaper Escaper An instance of an Escaper class that can escape query parts.
queryExecuter QueryExecuter An instance of a QueryExecuter that can execute CRUD operations.
Inherited From:
Source:

Methods

buildQuery() → {Query~QueryMeta}

Build the query.
Inherited From:
Source:
Returns:
The string-representation of the query to execute along with any query parameters.
Type
Query~QueryMeta

execute() → {Promise.<object>}

Execute the query.
Source:
Returns:
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).
Type
Promise.<object>

toString() → {string}

Create the UPDATE SQL statement.
Source:
Returns:
The UPDATE statement, as a SQL string.
Type
string