Class: Delete

Delete

A representation of a DELETE query.

Constructor

new Delete(from, tableAlias)

Initialize the query.
Parameters:
Name Type Description
from From An instance of a From.
tableAlias string The unique alias of the table from which records will be deleted. Optional, defaults to the alias of the from table.
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}

Execute the query.
Source:
Returns:
A promise instance that will be resolved with an object. The object will have an affectedRows property. If there is a failure executing the query, the returned promise will be rejected with that error.
Type
Promise

toString() → {string}

Create the delete SQL.
Source:
Returns:
The SQL representation of the DELETE statement.
Type
string