mStorage_api

Mixin. Provide CRUID operations for entity database persistent (ORM) using ubql query syntax

Methods

# addnew (ctxobject) 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

Arguments:
  • ctx: object
    • entitystring

      Entity code

    • methodstring

      Should be === 'lock'

    • execParamsobject

      Optional values for attributes of new record

    • fieldListarray.<string>

      Names of attributes to be returned in result.

# delete (ctxobject) static

Delete record by ID

Arguments:

# insert (ctxobject) static

New record insertion

Arguments:
  • ctx: object
    • entitystring

      Entity code

    • methodstring

      Should be === 'insert'

    • execParamsobject

      Pairs of attributeName: attributeValue to be inserted

    • fieldListarray.<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 (ubqlobject) static

ORM query for read records

Arguments:
  • ubql: object
    • entitystring

      Entity name

    • methodstring

      Method to use (usually === select)

    • fieldListarray.<string>

      Attributes expressions

    • whereListobject.<string, {expression: string, condition: string, value: *}>

      Where conditions

    • groupByarray.<string>

      Group by attributes expressions

    • orderByarray.<string>

      Order by attributes expressions

    • joinAsarray.<string>

      Array of condition names to use in join clause instead of where clause of result SQL

    • logicalPredicatesstring

      Optional logical concatenation of WHERE conditions

    • optionsobject

      Options for ORM query builder. See CustomRepository.misc documentation for possible values

    ORM query in UBQL format

# update (ctxobject) static

Update existed record

Arguments:
  • ctx: object
    • entitystring

      Entity code

    • methodstring

      Should be === 'update'

    • execParamsObject.<string, *>

      Pairs of attributeName: attributeValue to be updated

    • fieldListarray.<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