Class: InsertDBO

x2node-dbos~ InsertDBO

Insert database operation implementation (SQL INSERT query).

new InsertDBO(dbDriver, recordTypes, rcMonitor, recordTypeDesc, record)

Note: The constructor is not accessible from the client code. Instances are created using DBOFactory.
Parameters:
Name Type 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.
record Object The record data.

Extends

Methods


execute(txOrCon, actor)

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.
Returns:
Promise, which resolves to the new record id or is rejected with the error object of an error happens during the operation execution.
Type
Promise.<(string|number)>