src/DataBroker/DataBroker.js
/**
	 * Delete records that can be re-inserted later
	 * @param {String} table  The name of the table to delete from
	 * @param {Object} criteria  The criteria to match the records
	 * @returns {Promise<Object[]>}  An array of all the records
	 */
Delete records that can be re-inserted later
@param {String} table  The name of the table to delete from
@param {Object} criteria  The criteria to match the records
@returns {Promise}  An array of all the records
Delete records that can be re - inserted later @param { String } table The name of the table to delete from @param { Object } criteria The criteria to match the records @returns { Promise } An array of all the records
async delete(table, criteria) {
		const query = Select.init(this.db);
		query.table(table);
		query.where(criteria);
		const { results: recordset } = await query.fetch();
		await this.db.deleteFrom(table, criteria);
		if (!Array.isArray(this.deleted[table])) {
			this.deleted[table] = [];
		}
		this.deleted[table].push(...recordset);
		return recordset;
	}
async delete ( table , criteria ) { const query = Select . init ( this . db ) ; query . table ( table ) ; query . where ( criteria ) ; const { results : recordset } = await query . fetch ( ) ; await this . db . deleteFrom ( table , criteria ) ; if ( ! Array . isArray ( this . deleted [ table ] ) ) { this . deleted [ table ] = [ ] ; } this . deleted [ table ] . push ( ... recordset ) ; return recordset ; }
Delete records that can be re-inserted later
 @param {String} table  The name of the table to delete from
 @param {Object} criteria  The criteria to match the records
 @returns {Promise<Object[]>}  An array of all the records
Delete records that can be re - inserted later @param { String } table The name of the table to delete from @param { Object } criteria The criteria to match the records @returns { Promise<Object [] > } An array of all the records