Skip to main content
Version: 4.4

Interface: IQueryBuilder<T>#

knex.IQueryBuilder

Type parameters#

Name
T

Hierarchy#

  • IQueryBuilder

Properties#

_fields#

Optional _fields: undefined | 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[]): IQueryBuilder<T>

Parameters:#

NameType
fieldsstring | string[]

Returns: IQueryBuilder<T>

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


andWhere#

andWhere(cond: QBFilterQuery<T>): IQueryBuilder<T>

Parameters:#

NameType
condQBFilterQuery<T>

Returns: IQueryBuilder<T>

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

andWhere(cond: string, params?: any[]): IQueryBuilder<T>

Parameters:#

NameType
condstring
params?any[]

Returns: IQueryBuilder<T>

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


count#

count(field?: string | string[], distinct?: boolean): IQueryBuilder<T>

Parameters:#

NameType
field?string | string[]
distinct?boolean

Returns: IQueryBuilder<T>

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


delete#

delete(cond?: any): IQueryBuilder<T>

Parameters:#

NameType
cond?any

Returns: IQueryBuilder<T>

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


getAliasForJoinPath#

getAliasForJoinPath(path: string): undefined | string

Parameters:#

NameType
pathstring

Returns: undefined | string

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


getNextAlias#

getNextAlias(prefix?: string): string

Parameters:#

NameType
prefix?string

Returns: string

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


groupBy#

groupBy(fields: string | keyof T | (string | keyof T)[]): IQueryBuilder<T>

Parameters:#

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

Returns: IQueryBuilder<T>

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


having#

having(cond?: any, params?: any[]): IQueryBuilder<T>

Parameters:#

NameType
cond?any
params?any[]

Returns: IQueryBuilder<T>

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


insert#

insert(data: any): IQueryBuilder<T>

Parameters:#

NameType
dataany

Returns: IQueryBuilder<T>

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


join#

join(field: string, alias: string, cond?: any, type?: leftJoin | innerJoin | pivotJoin, path?: string): IQueryBuilder<T>

Parameters:#

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

Returns: IQueryBuilder<T>

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


joinAndSelect#

joinAndSelect(field: string, alias: string, cond?: any): IQueryBuilder<T>

Parameters:#

NameType
fieldstring
aliasstring
cond?any

Returns: IQueryBuilder<T>

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


leftJoin#

leftJoin(field: string, alias: string, cond?: any): IQueryBuilder<T>

Parameters:#

NameType
fieldstring
aliasstring
cond?any

Returns: IQueryBuilder<T>

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


leftJoinAndSelect#

leftJoinAndSelect(field: string, alias: string, cond?: any): IQueryBuilder<T>

Parameters:#

NameType
fieldstring
aliasstring
cond?any

Returns: IQueryBuilder<T>

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


orWhere#

orWhere(cond: QBFilterQuery<T>): IQueryBuilder<T>

Parameters:#

NameType
condQBFilterQuery<T>

Returns: IQueryBuilder<T>

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

orWhere(cond: string, params?: any[]): IQueryBuilder<T>

Parameters:#

NameType
condstring
params?any[]

Returns: IQueryBuilder<T>

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


orderBy#

orderBy(orderBy: QueryOrderMap): IQueryBuilder<T>

Parameters:#

NameType
orderByQueryOrderMap

Returns: IQueryBuilder<T>

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


select#

select(fields: string | KnexStringRef | QueryBuilder<any, any> | keyof T | Field<T>[], distinct?: boolean): IQueryBuilder<T>

Parameters:#

NameType
fieldsstring | KnexStringRef | QueryBuilder<any, any> | keyof T | Field<T>[]
distinct?boolean

Returns: IQueryBuilder<T>

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


truncate#

truncate(): IQueryBuilder<T>

Returns: IQueryBuilder<T>

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


update#

update(data: any): IQueryBuilder<T>

Parameters:#

NameType
dataany

Returns: IQueryBuilder<T>

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


where#

where(cond: QBFilterQuery<T>, operator?: $and | $or): IQueryBuilder<T>

Parameters:#

NameType
condQBFilterQuery<T>
operator?$and | $or

Returns: IQueryBuilder<T>

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

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

Parameters:#

NameType
condstring
params?any[]
operator?$and | $or

Returns: IQueryBuilder<T>

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


withSubQuery#

withSubQuery(subQuery: QueryBuilder<any, any>, alias: string): IQueryBuilder<T>

Parameters:#

NameType
subQueryQueryBuilder<any, any>
aliasstring

Returns: IQueryBuilder<T>

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

Last updated on by Martin Adámek