Skip to main content
Version: Next

IQueryBuilder <T>

Index

Properties

optional_fields

_fields?: Field<T>[]

readonlyalias

alias: string

optionalreadonlytype

type?: QueryType

Methods

addSelect

  • addSelect(fields: string | string[]): this
  • Parameters

    • fields: string | string[]

    Returns this

andWhere

  • andWhere(cond: QBFilterQuery<T>): this
  • andWhere(cond: string, params?: any[]): this

clone

count

  • count(field?: string | string[], distinct?: boolean): this
  • Parameters

    • optionalfield: string | string[]
    • optionaldistinct: boolean

    Returns this

delete

from

getAliasForJoinPath

getJoinForPath

getNextAlias

  • getNextAlias(entityName?: string): string
  • Parameters

    • optionalentityName: string

    Returns string

groupBy

  • groupBy(fields: string | keyof T | (string | keyof T)[]): this
  • Parameters

    • fields: string | keyof T | (string | keyof T)[]

    Returns this

hasFlag

having

  • Parameters

    Returns this

innerJoin

  • innerJoin(field: string, alias: string, cond?: QBFilterQuery): this
  • Parameters

    Returns this

innerJoinAndSelect

  • innerJoinAndSelect(field: string, alias: string, cond?: QBFilterQuery, fields?: string[]): this
  • Parameters

    • field: string
    • alias: string
    • optionalcond: QBFilterQuery
    • optionalfields: string[]

    Returns this

insert

  • insert(data: any): this
  • Parameters

    • data: any

    Returns this

join

  • Parameters

    Returns this

joinAndSelect

  • joinAndSelect(field: string, alias: string, cond?: QBFilterQuery): this
  • Parameters

    Returns this

leftJoin

  • leftJoin(field: string, alias: string, cond?: QBFilterQuery): this
  • Parameters

    Returns this

leftJoinAndSelect

  • leftJoinAndSelect(field: string, alias: string, cond?: QBFilterQuery, fields?: string[]): this
  • Parameters

    • field: string
    • alias: string
    • optionalcond: QBFilterQuery
    • optionalfields: string[]

    Returns this

orderBy

orWhere

  • orWhere(cond: QBFilterQuery<T>): this
  • orWhere(cond: string, params?: any[]): this

select

  • select(fields: Field<T> | Field<T>[], distinct?: boolean): this
  • Parameters

    • fields: Field<T> | Field<T>[]
    • optionaldistinct: boolean

    Returns this

setFlag

truncate

  • truncate(): this
  • Returns this

unsetFlag

update

  • update(data: any): this
  • Parameters

    • data: any

    Returns this

where

  • where(cond: QBFilterQuery<T>, operator?: $and | $or): this
  • where(cond: string, params?: any[], operator?: $and | $or): this
  • Parameters

    Returns this

withSubQuery

  • withSubQuery(subQuery: QueryBuilder<any, any>, alias: string): this
  • Parameters

    • subQuery: QueryBuilder<any, any>
    • alias: string

    Returns this