Class: DeleteDBO

x2node-dbos~ DeleteDBO

Delete database operation implementation (SQL DELETE query).

new DeleteDBO(dbDriver, recordTypes, rcMonitor, recordTypeDesc [, filterSpec])

Note: The constructor is not accessible from the client code. Instances are created using DBOFactory.
Parameters:
Name Type Argument Description
dbDriver module:x2node-dbos.DBDriver The database driver.
recordTypes module:x2node-records~RecordTypesLibrary Record types library.
rcMonitor module:x2node-dbos.RecordCollectionsMonitor The record collections monitor.
recordTypeDesc module:x2node-records~RecordTypeDescriptor The record type descriptor.
filterSpec Array.<Array> <optional>
Optional filter specification.

Extends

Methods


execute(txOrCon, actor [, filterParams])

Execute the operation.
Parameters:
Name Type Argument Description
txOrCon module:x2node-dbos~Transaction | * The active database transaction, or database connection object compatible with the database driver to have the method automatically organize the transaction around the operation execution.
actor module:x2node-common.Actor <nullable>
Actor executing the DBO.
filterParams Object.<string, *> <optional>
Filter parameters. The keys are parameter names, the values are parameter values. Note, that no value type conversion is performed: strings are used as SQL strings, numbers as SQL numbers, etc. Arrays are expanded into comma-separated lists of element values. Functions are called without arguments and the results are used as values. Otherwise, values can be strings, numbers, Booleans and nulls.
Throws:
If provided filter parameters object is invalid (missing parameter, NaN value or value of unsupported type).
Type
module:x2node-common.X2UsageError
Returns:
The operation result object promise.
Type
Promise.<module:x2node-dbos~DeleteDBO~Result>

Type Definitions


Result

Delete DBO execution result object. The result object's properties are names of record types, records of which were actually deleted, and the values are the numbers of records of the type deleted (zeros are not included).