Version: 4.3

Interface: IQueryBuilder<T>

Type parameters

Name
T

Hierarchy

  • IQueryBuilder

Properties

_fields

Optional _fields: Field<T>[]

Defined in packages/knex/src/typings.ts:88


alias

Readonly alias: string

Defined in packages/knex/src/typings.ts:86


type

Readonly type: QueryType

Defined in packages/knex/src/typings.ts:87

Methods

addSelect

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

Defined in packages/knex/src/typings.ts:90

Parameters:

NameType
fieldsstring | string[]

Returns: this


andWhere

andWhere(cond: QBFilterQuery<T>): this

Defined in packages/knex/src/typings.ts:101

Parameters:

NameType
condQBFilterQuery<T>

Returns: this

andWhere(cond: string, params?: any[]): this

Defined in packages/knex/src/typings.ts:102

Parameters:

NameType
condstring
params?any[]

Returns: this


count

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

Defined in packages/knex/src/typings.ts:95

Parameters:

NameType
field?string | string[]
distinct?boolean

Returns: this


delete

delete(cond?: QBFilterQuery): this

Defined in packages/knex/src/typings.ts:93

Parameters:

NameType
cond?QBFilterQuery

Returns: this


getAliasForJoinPath

getAliasForJoinPath(path: string): string | undefined

Defined in packages/knex/src/typings.ts:108

Parameters:

NameType
pathstring

Returns: string | undefined


getNextAlias

getNextAlias(prefix?: string): string

Defined in packages/knex/src/typings.ts:109

Parameters:

NameType
prefix?string

Returns: string


groupBy

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

Defined in packages/knex/src/typings.ts:106

Parameters:

NameType
fieldsstring | keyof T | (string | keyof T)[]

Returns: this


having

having(cond?: QBFilterQuery | string, params?: any[]): this

Defined in packages/knex/src/typings.ts:107

Parameters:

NameType
cond?QBFilterQuery | string
params?any[]

Returns: this


insert

insert(data: any): this

Defined in packages/knex/src/typings.ts:91

Parameters:

NameType
dataany

Returns: this


join

join(field: string, alias: string, cond?: QBFilterQuery, type?: "leftJoin" | "innerJoin" | "pivotJoin", path?: string): this

Defined in packages/knex/src/typings.ts:96

Parameters:

NameType
fieldstring
aliasstring
cond?QBFilterQuery
type?"leftJoin" | "innerJoin" | "pivotJoin"
path?string

Returns: this


leftJoin

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

Defined in packages/knex/src/typings.ts:97

Parameters:

NameType
fieldstring
aliasstring
cond?QBFilterQuery

Returns: this


orWhere

orWhere(cond: QBFilterQuery<T>): this

Defined in packages/knex/src/typings.ts:103

Parameters:

NameType
condQBFilterQuery<T>

Returns: this

orWhere(cond: string, params?: any[]): this

Defined in packages/knex/src/typings.ts:104

Parameters:

NameType
condstring
params?any[]

Returns: this


orderBy

orderBy(orderBy: QueryOrderMap): this

Defined in packages/knex/src/typings.ts:105

Parameters:

NameType
orderByQueryOrderMap

Returns: this


select

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

Defined in packages/knex/src/typings.ts:89

Parameters:

NameType
fieldsField<T> | Field<T>[]
distinct?boolean

Returns: this


truncate

truncate(): this

Defined in packages/knex/src/typings.ts:94

Returns: this


update

update(data: any): this

Defined in packages/knex/src/typings.ts:92

Parameters:

NameType
dataany

Returns: this


where

where(cond: QBFilterQuery<T>, operator?: keyof typeof GroupOperator): this

Defined in packages/knex/src/typings.ts:99

Parameters:

NameType
condQBFilterQuery<T>
operator?keyof typeof GroupOperator

Returns: this

where(cond: string, params?: any[], operator?: keyof typeof GroupOperator): this

Defined in packages/knex/src/typings.ts:100

Parameters:

NameType
condstring
params?any[]
operator?keyof typeof GroupOperator

Returns: this


withSubQuery

withSubQuery(subQuery: KnexQueryBuilder, alias: string): this

Defined in packages/knex/src/typings.ts:98

Parameters:

NameType
subQueryKnexQueryBuilder
aliasstring

Returns: this

Last updated on by Martin Adámek