DataStore

Execute the specified query against a local data source or a remove data source.

Methods

executeLocal

Execute the specified query against a local data source.

Parameter Type Description
query Query Defines parameters that will be used to query the data store.

Returns: Object[]

executeQuery

Execute the specified query against a local data source or a remove data source.

Parameter Type Description
query Query Defines parameters that will be used to query the data store.
done (optional) Function Defines a callback function triggered when the Promise is resolved.
fail (optional) Function Defines a callback function triggered when the Promise is rejected.
always (optional) Function Defines a callback function triggered when the Promise is resolved or rejected.

Returns: Object[]

insert

Insert a record into the specified data store.

Parameter Type Description
data Object Defines the data object to insert.
tableName (optional) String Query Defines the table name where the data will be inserted.
position (optional) Number Defines the position to where the data will be inserted.

Returns: Object Promise

remove

Remove a record from the specified data store using the given index.

Parameter Type Description
keyField String Defines the key column that will be used to lookup the given value.
value Object Defines the value of the record in the key field to be removed.
tableName (optional) String Query Defines the table name where the data will be removed.

Returns: Object Promise

saveChanges

Save all changes, including new records, updated records, and deleted records, to the specified data store.

Parameter Type Description
query Query Defines parameters that will be used to query the data store.

Returns: Object Promise

update

Update a record in the specified data store.

Parameter Type Description
keyField String Defines the key column that will be used to look up the given value.
value Object Defines the value of the record in the key field to be updated.
tableName (optional) String Query Defines the table name where the data will be updated.
original (optional) Object Defines the original value of the field.

Returns: Object Promise