Skip to main content
Version: 4.5

Interface: Knex<TRecord, TResult>#

knex.Knex

Type parameters#

NameTypeDefault
TRecordobjectany
TResult-unknown[]

Hierarchy#

Callable#

Knex<TTable>(tableName: TTable, options?: PgTableOptions): QueryBuilder<TableType<TTable>, DeferredKeySelection<ResolveTableType<TableType<TTable>, base>, never, false, {}, false, {}, never>[]>

Type parameters:#

NameType
TTablenever

Parameters:#

NameType
tableNameTTable
options?PgTableOptions

Returns: QueryBuilder<TableType<TTable>, DeferredKeySelection<ResolveTableType<TableType<TTable>, base>, never, false, {}, false, {}, never>[]>

Defined in: node_modules/knex/types/index.d.ts:332

Knex<TRecord2, TResult2>(tableName?: TableDescriptor | AliasDict, options?: PgTableOptions): QueryBuilder<TRecord2, TResult2>

Type parameters:#

NameDefault
TRecord2TRecord
TResult2DeferredKeySelection<TRecord2, never, false, {}, false, {}, never>[]

Parameters:#

NameType
tableName?TableDescriptor | AliasDict
options?PgTableOptions

Returns: QueryBuilder<TRecord2, TResult2>

Defined in: node_modules/knex/types/index.d.ts:336

Constructors#

constructor#

constructor: object

Inherited from: void

Properties#

RefMemberTag#

RefMemberTag: typeof RefMemberTag


VERSION#

VERSION: string

Defined in: node_modules/knex/types/index.d.ts:341


__knex__#

__knex__: string

Defined in: node_modules/knex/types/index.d.ts:342


andHaving#

andHaving: Having<TRecord, TResult>

Inherited from: QueryInterface.andHaving

Defined in: node_modules/knex/types/index.d.ts:544


andWhere#

andWhere: Where<TRecord, TResult>

Inherited from: QueryInterface.andWhere

Defined in: node_modules/knex/types/index.d.ts:498


andWhereBetween#

andWhereBetween: WhereBetween<TRecord, TResult>

Inherited from: QueryInterface.andWhereBetween

Defined in: node_modules/knex/types/index.d.ts:522


andWhereNot#

andWhereNot: Where<TRecord, TResult>

Inherited from: QueryInterface.andWhereNot

Defined in: node_modules/knex/types/index.d.ts:501


andWhereNotBetween#

andWhereNotBetween: WhereBetween<TRecord, TResult>

Inherited from: QueryInterface.andWhereNotBetween

Defined in: node_modules/knex/types/index.d.ts:525


andWhereRaw#

andWhereRaw: WhereRaw<TRecord, TResult>

Inherited from: QueryInterface.andWhereRaw

Defined in: node_modules/knex/types/index.d.ts:505


as#

as: As<TRecord, TResult>

Inherited from: QueryInterface.as

Defined in: node_modules/knex/types/index.d.ts:467


avg#

avg: TypePreservingAggregation<TRecord, TResult, any>

Inherited from: QueryInterface.avg

Defined in: node_modules/knex/types/index.d.ts:587


avgDistinct#

avgDistinct: TypePreservingAggregation<TRecord, TResult, any>

Inherited from: QueryInterface.avgDistinct

Defined in: node_modules/knex/types/index.d.ts:588


client#

client: any

Defined in: node_modules/knex/types/index.d.ts:375


column#

column: Select<TRecord, TResult>

Inherited from: QueryInterface.column

Defined in: node_modules/knex/types/index.d.ts:469


columns#

columns: Select<TRecord, TResult>

Inherited from: QueryInterface.columns

Defined in: node_modules/knex/types/index.d.ts:468


count#

count: AsymmetricAggregation<TRecord, TResult, string | number>

Inherited from: QueryInterface.count

Defined in: node_modules/knex/types/index.d.ts:581


countDistinct#

countDistinct: AsymmetricAggregation<TRecord, TResult, string | number>

Inherited from: QueryInterface.countDistinct

Defined in: node_modules/knex/types/index.d.ts:582


crossJoin#

crossJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.crossJoin

Defined in: node_modules/knex/types/index.d.ts:487


distinct#

distinct: Distinct<TRecord, TResult>

Inherited from: QueryInterface.distinct

Defined in: node_modules/knex/types/index.d.ts:474


distinctOn#

distinctOn: DistinctOn<TRecord, TResult>

Inherited from: QueryInterface.distinctOn

Defined in: node_modules/knex/types/index.d.ts:475


first#

first: Select<TRecord, AddUnionMember<UnwrapArrayMember<TResult>, undefined>>

Inherited from: QueryInterface.first

Defined in: node_modules/knex/types/index.d.ts:609


fn#

fn: FunctionHelper

Defined in: node_modules/knex/types/index.d.ts:378


from#

from: Table<TRecord, TResult>

Inherited from: QueryInterface.from

Defined in: node_modules/knex/types/index.d.ts:471


fullOuterJoin#

fullOuterJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.fullOuterJoin

Defined in: node_modules/knex/types/index.d.ts:486


groupBy#

groupBy: GroupBy<TRecord, TResult>

Inherited from: QueryInterface.groupBy

Defined in: node_modules/knex/types/index.d.ts:528


groupByRaw#

groupByRaw: RawQueryBuilder<TRecord, TResult>

Inherited from: QueryInterface.groupByRaw

Defined in: node_modules/knex/types/index.d.ts:529


having#

having: Having<TRecord, TResult>

Inherited from: QueryInterface.having

Defined in: node_modules/knex/types/index.d.ts:543


havingBetween#

havingBetween: HavingRange<TRecord, TResult>

Inherited from: QueryInterface.havingBetween

Defined in: node_modules/knex/types/index.d.ts:552


havingIn#

havingIn: HavingRange<TRecord, TResult>

Inherited from: QueryInterface.havingIn

Defined in: node_modules/knex/types/index.d.ts:548


havingNotBetween#

havingNotBetween: HavingRange<TRecord, TResult>

Inherited from: QueryInterface.havingNotBetween

Defined in: node_modules/knex/types/index.d.ts:550


havingRaw#

havingRaw: RawQueryBuilder<TRecord, TResult>

Inherited from: QueryInterface.havingRaw

Defined in: node_modules/knex/types/index.d.ts:545


havingWrapped#

havingWrapped: WhereWrapped<TRecord, TResult>

Inherited from: QueryInterface.havingWrapped

Defined in: node_modules/knex/types/index.d.ts:507


hintComment#

hintComment: HintComment<TRecord, TResult>

Inherited from: QueryInterface.hintComment

Defined in: node_modules/knex/types/index.d.ts:470


innerJoin#

innerJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.innerJoin

Defined in: node_modules/knex/types/index.d.ts:480


intersect#

intersect: Intersect<TRecord, TResult>

Inherited from: QueryInterface.intersect

Defined in: node_modules/knex/types/index.d.ts:536


into#

into: Table<TRecord, TResult>

Inherited from: QueryInterface.into

Defined in: node_modules/knex/types/index.d.ts:472


join#

join: Join<TRecord, TResult>

Inherited from: QueryInterface.join

Defined in: node_modules/knex/types/index.d.ts:478


joinRaw#

joinRaw: JoinRaw<TRecord, TResult>

Inherited from: QueryInterface.joinRaw

Defined in: node_modules/knex/types/index.d.ts:479


leftJoin#

leftJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.leftJoin

Defined in: node_modules/knex/types/index.d.ts:481


leftOuterJoin#

leftOuterJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.leftOuterJoin

Defined in: node_modules/knex/types/index.d.ts:482


max#

max: TypePreservingAggregation<TRecord, TResult, any>

Inherited from: QueryInterface.max

Defined in: node_modules/knex/types/index.d.ts:584


migrate#

migrate: Migrator

Defined in: node_modules/knex/types/index.d.ts:376


min#

min: TypePreservingAggregation<TRecord, TResult, any>

Inherited from: QueryInterface.min

Defined in: node_modules/knex/types/index.d.ts:583


orHaving#

orHaving: Having<TRecord, TResult>

Inherited from: QueryInterface.orHaving

Defined in: node_modules/knex/types/index.d.ts:546


orHavingBetween#

orHavingBetween: HavingRange<TRecord, TResult>

Inherited from: QueryInterface.orHavingBetween

Defined in: node_modules/knex/types/index.d.ts:551


orHavingNotBetween#

orHavingNotBetween: HavingRange<TRecord, TResult>

Inherited from: QueryInterface.orHavingNotBetween

Defined in: node_modules/knex/types/index.d.ts:549


orHavingRaw#

orHavingRaw: RawQueryBuilder<TRecord, TResult>

Inherited from: QueryInterface.orHavingRaw

Defined in: node_modules/knex/types/index.d.ts:547


orWhere#

orWhere: Where<TRecord, TResult>

Inherited from: QueryInterface.orWhere

Defined in: node_modules/knex/types/index.d.ts:499


orWhereBetween#

orWhereBetween: WhereBetween<TRecord, TResult>

Inherited from: QueryInterface.orWhereBetween

Defined in: node_modules/knex/types/index.d.ts:521


orWhereExists#

orWhereExists: WhereExists<TRecord, TResult>

Inherited from: QueryInterface.orWhereExists

Defined in: node_modules/knex/types/index.d.ts:509


orWhereIn#

orWhereIn: WhereIn<TRecord, TResult>

Inherited from: QueryInterface.orWhereIn

Defined in: node_modules/knex/types/index.d.ts:513


orWhereNot#

orWhereNot: Where<TRecord, TResult>

Inherited from: QueryInterface.orWhereNot

Defined in: node_modules/knex/types/index.d.ts:502


orWhereNotBetween#

orWhereNotBetween: WhereBetween<TRecord, TResult>

Inherited from: QueryInterface.orWhereNotBetween

Defined in: node_modules/knex/types/index.d.ts:524


orWhereNotExists#

orWhereNotExists: WhereExists<TRecord, TResult>

Inherited from: QueryInterface.orWhereNotExists

Defined in: node_modules/knex/types/index.d.ts:511


orWhereNotIn#

orWhereNotIn: WhereIn<TRecord, TResult>

Inherited from: QueryInterface.orWhereNotIn

Defined in: node_modules/knex/types/index.d.ts:515


orWhereNotNull#

orWhereNotNull: WhereNull<TRecord, TResult>

Inherited from: QueryInterface.orWhereNotNull

Defined in: node_modules/knex/types/index.d.ts:519


orWhereNull#

orWhereNull: WhereNull<TRecord, TResult>

Inherited from: QueryInterface.orWhereNull

Defined in: node_modules/knex/types/index.d.ts:517


orWhereRaw#

orWhereRaw: WhereRaw<TRecord, TResult>

Inherited from: QueryInterface.orWhereRaw

Defined in: node_modules/knex/types/index.d.ts:504


orderBy#

orderBy: OrderBy<TRecord, TResult>

Inherited from: QueryInterface.orderBy

Defined in: node_modules/knex/types/index.d.ts:532


orderByRaw#

orderByRaw: RawQueryBuilder<TRecord, TResult>

Inherited from: QueryInterface.orderByRaw

Defined in: node_modules/knex/types/index.d.ts:533


outerJoin#

outerJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.outerJoin

Defined in: node_modules/knex/types/index.d.ts:485


raw#

raw: RawBuilder<TRecord, any>

Defined in: node_modules/knex/types/index.d.ts:344


ref#

ref: RefBuilder

Defined in: node_modules/knex/types/index.d.ts:379


rightJoin#

rightJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.rightJoin

Defined in: node_modules/knex/types/index.d.ts:483


rightOuterJoin#

rightOuterJoin: Join<TRecord, TResult>

Inherited from: QueryInterface.rightOuterJoin

Defined in: node_modules/knex/types/index.d.ts:484


schema#

schema: SchemaBuilder

Defined in: node_modules/knex/types/index.d.ts:369


seed#

seed: Seeder

Defined in: node_modules/knex/types/index.d.ts:377


select#

select: Select<TRecord, TResult>

Inherited from: QueryInterface.select

Defined in: node_modules/knex/types/index.d.ts:466


sum#

sum: TypePreservingAggregation<TRecord, TResult, any>

Inherited from: QueryInterface.sum

Defined in: node_modules/knex/types/index.d.ts:585


sumDistinct#

sumDistinct: TypePreservingAggregation<TRecord, TResult, any>

Inherited from: QueryInterface.sumDistinct

Defined in: node_modules/knex/types/index.d.ts:586


table#

table: Table<TRecord, TResult>

Inherited from: QueryInterface.table

Defined in: node_modules/knex/types/index.d.ts:473


union#

union: Union<TRecord, TResult>

Inherited from: QueryInterface.union

Defined in: node_modules/knex/types/index.d.ts:539


unionAll#

unionAll: Union<TRecord, TResult>

Inherited from: QueryInterface.unionAll

Defined in: node_modules/knex/types/index.d.ts:540


userParams#

userParams: Record<string, any>

Defined in: node_modules/knex/types/index.d.ts:380


where#

where: Where<TRecord, TResult>

Inherited from: QueryInterface.where

Defined in: node_modules/knex/types/index.d.ts:497


whereBetween#

whereBetween: WhereBetween<TRecord, TResult>

Inherited from: QueryInterface.whereBetween

Defined in: node_modules/knex/types/index.d.ts:520


whereExists#

whereExists: WhereExists<TRecord, TResult>

Inherited from: QueryInterface.whereExists

Defined in: node_modules/knex/types/index.d.ts:508


whereIn#

whereIn: WhereIn<TRecord, TResult>

Inherited from: QueryInterface.whereIn

Defined in: node_modules/knex/types/index.d.ts:512


whereNot#

whereNot: Where<TRecord, TResult>

Inherited from: QueryInterface.whereNot

Defined in: node_modules/knex/types/index.d.ts:500


whereNotBetween#

whereNotBetween: WhereBetween<TRecord, TResult>

Inherited from: QueryInterface.whereNotBetween

Defined in: node_modules/knex/types/index.d.ts:523


whereNotExists#

whereNotExists: WhereExists<TRecord, TResult>

Inherited from: QueryInterface.whereNotExists

Defined in: node_modules/knex/types/index.d.ts:510


whereNotIn#

whereNotIn: WhereIn<TRecord, TResult>

Inherited from: QueryInterface.whereNotIn

Defined in: node_modules/knex/types/index.d.ts:514


whereNotNull#

whereNotNull: WhereNull<TRecord, TResult>

Inherited from: QueryInterface.whereNotNull

Defined in: node_modules/knex/types/index.d.ts:518


whereNull#

whereNull: WhereNull<TRecord, TResult>

Inherited from: QueryInterface.whereNull

Defined in: node_modules/knex/types/index.d.ts:516


whereRaw#

whereRaw: WhereRaw<TRecord, TResult>

Inherited from: QueryInterface.whereRaw

Defined in: node_modules/knex/types/index.d.ts:503


whereWrapped#

whereWrapped: WhereWrapped<TRecord, TResult>

Inherited from: QueryInterface.whereWrapped

Defined in: node_modules/knex/types/index.d.ts:506


with#

with: With<TRecord, TResult>

Inherited from: QueryInterface.with

Defined in: node_modules/knex/types/index.d.ts:490


withRaw#

withRaw: WithRaw<TRecord, TResult>

Inherited from: QueryInterface.withRaw

Defined in: node_modules/knex/types/index.d.ts:492


withRecursive#

withRecursive: With<TRecord, TResult>

Inherited from: QueryInterface.withRecursive

Defined in: node_modules/knex/types/index.d.ts:491


withSchema#

withSchema: WithSchema<TRecord, TResult>

Inherited from: QueryInterface.withSchema

Defined in: node_modules/knex/types/index.d.ts:493


withWrapped#

withWrapped: WithWrapped<TRecord, TResult>

Inherited from: QueryInterface.withWrapped

Defined in: node_modules/knex/types/index.d.ts:494

Methods#

addListener#

addListener(event: string | symbol, listener: (...args: any[]) => void): Knex<TRecord, TResult>

Parameters:#

NameType
eventstring | symbol
listener(...args: any[]) => void

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:62


batchInsert#

batchInsert<TRecord2, TResult2>(tableName: TableDescriptor, data: TRecord2 extends CompositeTableType<unknown, unknown, Partial<unknown>> ? readonly ResolveTableType<TRecord2, insert>[] : readonly DbRecordArr<TRecord2>[], chunkSize?: number): BatchInsertBuilder<TRecord2, TResult2>

Type parameters:#

NameDefault
TRecord2TRecord
TResult2number[]

Parameters:#

NameType
tableNameTableDescriptor
dataTRecord2 extends CompositeTableType<unknown, unknown, Partial<unknown>> ? readonly ResolveTableType<TRecord2, insert>[] : readonly DbRecordArr<TRecord2>[]
chunkSize?number

Returns: BatchInsertBuilder<TRecord2, TResult2>

Defined in: node_modules/knex/types/index.d.ts:361


clear#

clear(statement: ClearStatements): QueryBuilder<TRecord, TResult>

Parameters:#

NameType
statementClearStatements

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:574


clearCounters#

clearCounters(): QueryBuilder<TRecord, TResult>

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:573


clearGroup#

clearGroup(): QueryBuilder<TRecord, TResult>

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:570


clearHaving#

clearHaving(): QueryBuilder<TRecord, TResult>

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:572


clearOrder#

clearOrder(): QueryBuilder<TRecord, TResult>

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:571


clearSelect#

clearSelect(): QueryBuilder<TRecord, UnwrapArrayMember<TResult> extends DeferredKeySelection<TBase, TKeys, true, any, any, any, any> ? DeferredKeySelection<TBase, never, false, {}, false, {}, never>[] : TResult>

Returns: QueryBuilder<TRecord, UnwrapArrayMember<TResult> extends DeferredKeySelection<TBase, TKeys, true, any, any, any, any> ? DeferredKeySelection<TBase, never, false, {}, false, {}, never>[] : TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:555


clearWhere#

clearWhere(): QueryBuilder<TRecord, TResult>

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:569


decrement#

decrement(columnName: keyof TRecord, amount?: number): QueryBuilder<TRecord, number>

Parameters:#

NameType
columnNamekeyof TRecord
amount?number

Returns: QueryBuilder<TRecord, number>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:599

decrement(columnName: string, amount?: number): QueryBuilder<TRecord, number>

Parameters:#

NameType
columnNamestring
amount?number

Returns: QueryBuilder<TRecord, number>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:603


del#

del(returning: **, options?: DMLOptions): [QueryBuilder](/docs/api/classes/knex.knex-1.querybuilder)<TRecord, DeferredKeySelection<TRecord, never, false, {}, false*, {}, never>[]>

Parameters:#

NameType
returning***
options?DMLOptions

Returns: QueryBuilder<TRecord, DeferredKeySelection<TRecord, never, false, {}, false, {}, never>[]>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:833

del<TKey, TResult2>(returning: TKey, options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, true>[]

Parameters:#

NameType
returningTKey
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:837

del<TKey, TResult2>(returning: readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2[]>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, {}>[]

Parameters:#

NameType
returningreadonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2[]>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:848

del<TResult2>(returning: string | readonly string[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2Partial<AnyOrUnknownToOther<TRecord, {}>>[]

Parameters:#

NameType
returningstring | readonly string[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:859

del<TResult2>(): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2number

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:863


delete#

delete(returning: **, options?: DMLOptions): [QueryBuilder](/docs/api/classes/knex.knex-1.querybuilder)<TRecord, DeferredKeySelection<TRecord, never, false, {}, false*, {}, never>[]>

Parameters:#

NameType
returning***
options?DMLOptions

Returns: QueryBuilder<TRecord, DeferredKeySelection<TRecord, never, false, {}, false, {}, never>[]>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:865

delete<TKey, TResult2>(returning: TKey, options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, TKey>, true>[]

Parameters:#

NameType
returningTKey
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:869

delete<TKey, TResult2>(returning: readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, {}>[]

Parameters:#

NameType
returningreadonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:880

delete<TResult2>(returning: string | readonly string[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2any

Parameters:#

NameType
returningstring | readonly string[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:891

delete<TResult2>(): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2number

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:895


destroy#

destroy(callback: Function): void

Parameters:#

NameType
callbackFunction

Returns: void

Defined in: node_modules/knex/types/index.d.ts:358

destroy(): Promise<void>

Returns: Promise<void>

Defined in: node_modules/knex/types/index.d.ts:359


emit#

emit(event: string | symbol, ...args: any[]): boolean

Parameters:#

NameType
eventstring | symbol
...argsany[]

Returns: boolean

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:72


eventNames#

eventNames(): (string | symbol)[]

Returns: (string | symbol)[]

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:77


getMaxListeners#

getMaxListeners(): number

Returns: number

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:69


increment#

increment(columnName: keyof TRecord, amount?: number): QueryBuilder<TRecord, number>

Parameters:#

NameType
columnNamekeyof TRecord
amount?number

Returns: QueryBuilder<TRecord, number>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:590

increment(columnName: string, amount?: number): QueryBuilder<TRecord, number>

Parameters:#

NameType
columnNamestring
amount?number

Returns: QueryBuilder<TRecord, number>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:594


initialize#

initialize(config?: Config<any>): void

Parameters:#

NameType
config?Config<any>

Returns: void

Defined in: node_modules/knex/types/index.d.ts:357


insert#

insert(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[], returning: **, options?: DMLOptions): [QueryBuilder](/docs/api/classes/knex.knex-1.querybuilder)<TRecord, DeferredKeySelection<TRecord, never, false, {}, false*, {}, never>[]>

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[]
returning***
options?DMLOptions

Returns: QueryBuilder<TRecord, DeferredKeySelection<TRecord, never, false, {}, false, {}, never>[]>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:616

insert<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[], returning: TKey, options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, TKey>, true>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[]
returningTKey
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:623

insert<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[], returning: readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, TKey>, {}>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[]
returningreadonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:637

insert<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[], returning: TKey, options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, true>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[]
returningTKey
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:651

insert<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[], returning: readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, true>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[]
returningreadonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:665

insert<TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[]): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2number[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, insert> | readonly ResolveTableType<TRecord, insert>[] : DbRecordArr<TRecord> | readonly DbRecordArr<TRecord>[]

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:679


limit#

limit(limit: number): QueryBuilder<TRecord, TResult>

Parameters:#

NameType
limitnumber

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:578


listenerCount#

listenerCount(event: string | symbol): number

Parameters:#

NameType
eventstring | symbol

Returns: number

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:73


listeners#

listeners(event: string | symbol): Function[]

Parameters:#

NameType
eventstring | symbol

Returns: Function[]

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:70


modify#

modify<TRecord2, TResult2>(callback: QueryCallbackWithArgs<TRecord, any>, ...args: any[]): QueryBuilder<TRecord2, TResult2>

Type parameters:#

NameTypeDefault
TRecord2objectany
TResult2objectany

Parameters:#

NameType
callbackQueryCallbackWithArgs<TRecord, any>
...argsany[]

Returns: QueryBuilder<TRecord2, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:685


off#

off(event: string | symbol, listener: (...args: any[]) => void): Knex<TRecord, TResult>

Parameters:#

NameType
eventstring | symbol
listener(...args: any[]) => void

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:66


offset#

offset(offset: number): QueryBuilder<TRecord, TResult>

Parameters:#

NameType
offsetnumber

Returns: QueryBuilder<TRecord, TResult>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:577


on#

on(event: string | symbol, listener: (...args: any[]) => void): Knex<TRecord, TResult>

Parameters:#

NameType
eventstring | symbol
listener(...args: any[]) => void

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:63


onConflict#

onConflict<TKey, TResult2>(column: TKey): OnConflictQueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, true>[]

Parameters:#

NameType
columnTKey

Returns: OnConflictQueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:813

onConflict<TKey, TResult2>(columns: readonly TKey[]): OnConflictQueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, {}>, false>[]

Parameters:#

NameType
columnsreadonly TKey[]

Returns: OnConflictQueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:823


once#

once(event: string | symbol, listener: (...args: any[]) => void): Knex<TRecord, TResult>

Parameters:#

NameType
eventstring | symbol
listener(...args: any[]) => void

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:64


pluck#

pluck<K>(column: K): QueryBuilder<TRecord, TRecord[K][]>

Type parameters:#

NameType
Kstring | number | symbol

Parameters:#

NameType
columnK

Returns: QueryBuilder<TRecord, TRecord[K][]>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:611

pluck<TResult2>(column: string): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameType
TResult2object

Parameters:#

NameType
columnstring

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:614


prependListener#

prependListener(event: string | symbol, listener: (...args: any[]) => void): Knex<TRecord, TResult>

Parameters:#

NameType
eventstring | symbol
listener(...args: any[]) => void

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:75


prependOnceListener#

prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Knex<TRecord, TResult>

Parameters:#

NameType
eventstring | symbol
listener(...args: any[]) => void

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:76


queryBuilder#

queryBuilder<TRecord2, TResult2>(): QueryBuilder<TRecord2, TResult2>

Type parameters:#

NameDefault
TRecord2TRecord
TResult2TResult

Returns: QueryBuilder<TRecord2, TResult2>

Defined in: node_modules/knex/types/index.d.ts:370


rawListeners#

rawListeners(event: string | symbol): Function[]

Parameters:#

NameType
eventstring | symbol

Returns: Function[]

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:71


removeAllListeners#

removeAllListeners(event?: string | symbol): Knex<TRecord, TResult>

Parameters:#

NameType
event?string | symbol

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:67


removeListener#

removeListener(event: string | symbol, listener: (...args: any[]) => void): Knex<TRecord, TResult>

Parameters:#

NameType
eventstring | symbol
listener(...args: any[]) => void

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:65


returning#

returning(column: **, options?: DMLOptions): [QueryBuilder](/docs/api/classes/knex.knex-1.querybuilder)<TRecord, DeferredKeySelection<TRecord, never, false, {}, false*, {}, never>[]>

Parameters:#

NameType
column***
options?DMLOptions

Returns: QueryBuilder<TRecord, DeferredKeySelection<TRecord, never, false, {}, false, {}, never>[]>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:786

returning<TKey, TResult2>(column: TKey, options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, TKey>, true>[]

Parameters:#

NameType
columnTKey
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:787

returning<TKey, TResult2>(columns: readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, TKey>, {}>, false>[]

Parameters:#

NameType
columnsreadonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:798

returning<TResult2>(column: string | readonly string[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2Partial<AnyOrUnknownToOther<TRecord, {}>>[]

Parameters:#

NameType
columnstring | readonly string[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:808


setMaxListeners#

setMaxListeners(n: number): Knex<TRecord, TResult>

Parameters:#

NameType
nnumber

Returns: Knex<TRecord, TResult>

Inherited from: void

Defined in: node_modules/@types/node/events.d.ts:68


transaction#

transaction(transactionScope?: null, config?: any): Promise<Transaction<any, any>>

Parameters:#

NameType
transactionScope?null
config?any

Returns: Promise<Transaction<any, any>>

Defined in: node_modules/knex/types/index.d.ts:349

transaction<T>(transactionScope: (trx: Transaction<any, any>) => void | Promise<T>, config?: any): Promise<T>

Type parameters:#

Name
T

Parameters:#

NameType
transactionScope(trx: Transaction<any, any>) => void | Promise<T>
config?any

Returns: Promise<T>

Defined in: node_modules/knex/types/index.d.ts:353


transactionProvider#

transactionProvider(config?: any): function

Parameters:#

NameType
config?any

Returns: () => Promise<Transaction<any, any>>

Defined in: node_modules/knex/types/index.d.ts:346


truncate#

truncate(): QueryBuilder<TRecord, void>

Returns: QueryBuilder<TRecord, void>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:897


update#

update<K1, K2, TResult2>(columnName: K1, value: DbColumn<ResolveTableType<TRecord, update>[K1]>, returning: K2, options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
K1string-
K2string-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, K2>, true>[]

Parameters:#

NameType
columnNameK1
valueDbColumn<ResolveTableType<TRecord, update>[K1]>
returningK2
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:689

update<K1, K2, TResult2>(columnName: K1, value: DbColumn<ResolveTableType<TRecord, update>[K1]>, returning: readonly K2[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
K1string-
K2string-
TResult2-AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, K2>, {}>[]

Parameters:#

NameType
columnNameK1
valueDbColumn<ResolveTableType<TRecord, update>[K1]>
returningreadonly K2[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:703

update<K>(columnName: K, value: DbColumn<TRecord[K]>): QueryBuilder<TRecord, number>

Type parameters:#

NameType
Kstring | number | symbol

Parameters:#

NameType
columnNameK
valueDbColumn<TRecord[K]>

Returns: QueryBuilder<TRecord, number>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:717

update<TResult2>(columnName: string, value: Value, returning: string | readonly string[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2Partial<AnyOrUnknownToOther<TRecord, {}>>[]

Parameters:#

NameType
columnNamestring
valueValue
returningstring | readonly string[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:721

update(data: DbRecordArr<TRecord>, returning: **, options?: DMLOptions): [QueryBuilder](/docs/api/classes/knex.knex-1.querybuilder)<TRecord, DeferredKeySelection<TRecord, never, false, {}, false*, {}, never>[]>

Parameters:#

NameType
dataDbRecordArr<TRecord>
returning***
options?DMLOptions

Returns: QueryBuilder<TRecord, DeferredKeySelection<TRecord, never, false, {}, false, {}, never>[]>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:727

update<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>, returning: TKey, options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-SetSingle<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, TKey>, true>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>
returningTKey
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:732

update<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>, returning: readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2-AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, ResolveTableType<TRecord, base>>, TKey>, {}>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>
returningreadonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:744

update<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>, returning: TKey | readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystringstring
TResult2{}[]AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, {}>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>
returningTKey | readonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:756

update<TKey, TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>, returning: readonly TKey[], options?: DMLOptions): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameTypeDefault
TKeystring-
TResult2{}[]AddAliases<AddKey<SetBase<UnwrapArrayMember<TResult>, TRecord>, TKey>, {}>[]

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>
returningreadonly TKey[]
options?DMLOptions

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:768

update<TResult2>(data: TRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2number

Parameters:#

NameType
dataTRecord extends CompositeTableType<unknown, unknown, Partial<unknown>> ? ResolveTableType<TRecord, update> : DbRecordArr<TRecord>

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:780

update<TResult2>(columnName: string, value: Value): QueryBuilder<TRecord, TResult2>

Type parameters:#

NameDefault
TResult2number

Parameters:#

NameType
columnNamestring
valueValue

Returns: QueryBuilder<TRecord, TResult2>

Inherited from: QueryInterface

Defined in: node_modules/knex/types/index.d.ts:784


withUserParams#

withUserParams(params: Record<string, any>): Knex<any, unknown[]>

Parameters:#

NameType
paramsRecord<string, any>

Returns: Knex<any, unknown[]>

Defined in: node_modules/knex/types/index.d.ts:381

Last updated on by Renovate Bot