SQLiteStORM supported methods

Connecting

Creating tables

setup() - Creates the table by inspecting the object. Columns will be created that relate to the assigned type of the property. Properties beginning with an underscore or "internal_" will be ignored.

NOTE: The primary key is first property defined in the class.

Saving objects

save() - Saves object. Creates a new row if no primary key is assigned, otherwise performs an update.

save {id in ... } - Saves object. Creates a new row if no primary key is assigned, otherwise performs an update. The closure returns the new id if created.

create() - Forces the creation of a new row, even if a primary key has been supplied.

Retrieving data

findAll() - Retrieves all rows in the table, only limited by the cursor (9,999,999 rows)

get() - Retrieves the row. Assumes primary key has been set in the object.

get(Any) - Retrieves the row with primary key supplied.

find([(String, Any)]) - Performs a find, where the pairs supplied are name/value pairs corresponding to column names and find criteria.

select(whereclause: String,
params: [Any],
orderby: [String]) - Performs a select with a specified where clause, having the values parameterized to protect from SQL injection. The orderby array is an array of column names that can optionally include the "ASC" or "DESC" keywords to indicate sort direction.

Updates

update(cols: [String], params: [Any], idName: String, idValue: Any) - Updates the row by specifying data as matching arrays of column names, and the associated value. A primary key value, and an idName column name are also required.