@cashfarm/store
Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

db

db: IPool

DTO

DTO: symbol = Sym.DTO

TABLE

TABLE: symbol = Sym.TABLE

Accessors

newQuery

newQuery:

Methods

compute

  • compute<TScalar>(expression: string, defaultValue?: TScalar): Promise<TScalar>
  • compute<TScalar>(queryOrBuilder: Types.QueryOrBuilder<TTable>, defaultValue?: TScalar): Promise<TScalar>
  • Select a single field or expression and return its value

    template

    TScalar

    memberof

    MysqlStore

    Type parameters

    • TScalar

    Parameters

    • expression: string

      A select expression. E.g. "COUNT(id)"

    • Optional defaultValue: TScalar

    Returns Promise<TScalar>

  • Select a single field or expression and return its value

    template

    TScalar

    memberof

    MysqlStore

    Type parameters

    • TScalar

    Parameters

    • queryOrBuilder: Types.QueryOrBuilder<TTable>

      A query or a query builder function. E.g. t => t.id

    • Optional defaultValue: TScalar

    Returns Promise<TScalar>

create

  • create(obj: TDto): Promise<TDto>

delete

find

  • find(queryOrBuilder: Types.QueryBuilder<TTable>, dtoMapper?: function): Promise<TDto[]>
  • Parameters

    • queryOrBuilder: Types.QueryBuilder<TTable>
    • Optional dtoMapper: function
        • (rows: any[]): TDto[]
        • Parameters

          • rows: any[]

          Returns TDto[]

    Returns Promise<TDto[]>

findOne

  • findOne(query: IQuery<TTable>): Promise<TDto>
  • findOne(query: Types.QueryBuilder<TTable>): Promise<TDto>

runCommand

  • runCommand(command: string): Promise<any>

update

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc