Class: TransactionSet

parasql.schema.TransactionSet()

new TransactionSet()

TransactionSet class. This class is a container for one or more DataTables. Saving a TransactionSet causes all changes to its DataTables to be saved to the database.
Since:
  • v63

Extends

  • Object

Methods

addNewDataTable(tableName) → {parasql.schema.DataTable}

Parameters:
Name Type Description
tableName string
Returns:
A newly created DataTable.
Type
parasql.schema.DataTable

getDataTable(tableName) → (nullable) {parasql.schema.DataTable}

Parameters:
Name Type Description
tableName string
Returns:
Type
parasql.schema.DataTable

isDirty() → {boolean}

Returns:
True if this TransactionSet is dirty (contains unsaved changes).
Type
boolean

markAsSaved()

Tells each DataTable in this TransactionSet to markAsSaved.

save(callbacknullable)

Cause this TransactionSet to attempt to save all changes to its DataTable objects since the change tracker was last reset. New rows will be inserted, modified rows will be updated, and rows marked for delete will be deleted. All operations are performed within a single transaction and committed if successful and rolled back on error. If the save is successful, this TransactionSet will automatically be markAsSaved. This method does nothing if this TransactionSet is not dirty.
Parameters:
Name Type Attributes Description
callback function <nullable>
Optional function to be called after this save operation completes; the callback function will be passed a single parameter that is a JSON object with the following structure: {status:string, errorMessage:string} where status will be either OK or ERROR.
Since:
  • v62