mStorage_api
Mixin. Provide CRUID operations for entity database persistent (ORM) using ubql
query syntax
Methods
# addnew (ctx: object) static
Create record with filled default values and return it to caller.
Newly created record is not inserted to database. For inserting record to the database insert
method should be called
# delete (ctx: object) static
Delete record by ID
# insert (ctx: object) static
New record insertion
Arguments:
ctx
: objectentity
: stringEntity code
method
: stringShould be === 'insert'
execParams
: objectPairs of attributeName: attributeValue to be inserted
fieldList
: array.<string>Optional names of attributes to be returned in result. Additional DB query is required to return values, so if caller do not need it better to not pass a fieldList to insert
# select (ubql: object) static
ORM query for read records
Arguments:
ubql
: objectentity
: stringEntity name
method
: stringMethod to use (usually === select)
fieldList
: array.<string>Attributes expressions
whereList
: object.<string, {expression: string, condition: string, value: *}>Where conditions
groupBy
: array.<string>Group by attributes expressions
orderBy
: array.<string>Order by attributes expressions
joinAs
: array.<string>Array of condition names to use in join clause instead of where clause of result SQL
logicalPredicates
: stringOptional logical concatenation of WHERE conditions
options
: objectOptions for ORM query builder. See CustomRepository.misc documentation for possible values
ORM query in UBQL format
# update (ctx: object) static
Update existed record
Arguments:
ctx
: objectentity
: stringEntity code
method
: stringShould be === 'update'
execParams
: Object.<string, *>Pairs of attributeName: attributeValue to be updated
fieldList
: array.<string>Optional names of attributes to be returned in result. Additional DB query is required to return values, so if caller do not need it better to not pass a fieldList to update