Skip to main content
Version: 4.5

Class: QueryBuilderHelper#

knex.QueryBuilderHelper

Constructors#

constructor#

+ new QueryBuilderHelper(entityName: string, alias: string, aliasMap: Dictionary<string>, subQueries: Dictionary<string>, metadata: MetadataStorage, knex: Knex<any, unknown[]>, platform: Platform): QueryBuilderHelper

Parameters:#

NameType
entityNamestring
aliasstring
aliasMapDictionary<string>
subQueriesDictionary<string>
metadataMetadataStorage
knexKnex<any, unknown[]>
platformPlatform

Returns: QueryBuilderHelper

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:20

Methods#

appendGroupCondition#

PrivateappendGroupCondition(type: QueryType, qb: QueryBuilder<any, any>, operator: $and | $or, method: having | where, subCondition: any[]): void

Parameters:#

NameType
typeQueryType
qbQueryBuilder<any, any>
operator$and | $or
methodhaving | where
subConditionany[]

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:525


appendJoinClause#

PrivateappendJoinClause(clause: JoinClause, cond: Dictionary<any>, operator?: $and | $or): void

Parameters:#

NameType
clauseJoinClause
condDictionary<any>
operator?$and | $or

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:369


appendJoinSubClause#

PrivateappendJoinSubClause(clause: JoinClause, cond: Dictionary<any>, key: string, operator?: $and | $or): void

Parameters:#

NameType
clauseJoinClause
condDictionary<any>
keystring
operator?$and | $or

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:387


appendQueryCondition#

appendQueryCondition(type: QueryType, cond: any, qb: QueryBuilder<any, any>, operator?: $and | $or, method?: having | where): void

Parameters:#

NameTypeDefault value
typeQueryType-
condany-
qbQueryBuilder<any, any>-
operator?$and | $or-
methodhaving | where'where'

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:260


appendQuerySubCondition#

PrivateappendQuerySubCondition(qb: QueryBuilder<any, any>, type: QueryType, method: having | where, cond: any, key: string, operator?: $and | $or): void

Parameters:#

NameType
qbQueryBuilder<any, any>
typeQueryType
methodhaving | where
condany
keystring
operator?$and | $or

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:281


fieldName#

PrivatefieldName(field: string, alias?: string): string

Parameters:#

NameType
fieldstring
alias?string

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:549


finalize#

finalize(type: QueryType, qb: QueryBuilder<any, any>, meta?: EntityMetadata<any>): void

Parameters:#

NameType
typeQueryType
qbQueryBuilder<any, any>
meta?EntityMetadata<any>

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:453


getLockSQL#

getLockSQL(qb: QueryBuilder<any, any>, lockMode?: LockMode): void

Parameters:#

NameType
qbQueryBuilder<any, any>
lockMode?LockMode

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:470


getOperatorReplacement#

PrivategetOperatorReplacement(op: string, value: Dictionary<any>): string

Parameters:#

NameType
opstring
valueDictionary<any>

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:355


getProperty#

PrivategetProperty(field: string, alias?: string): undefined | EntityProperty<any>

Parameters:#

NameType
fieldstring
alias?string

Returns: undefined | EntityProperty<any>

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:564


getQueryOrder#

getQueryOrder(type: QueryType, orderBy: FlatQueryOrderMap, populate: Dictionary<string>): string

Parameters:#

NameType
typeQueryType
orderByFlatQueryOrderMap
populateDictionary<string>

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:425


getRegExpParam#

getRegExpParam(re: RegExp): string

Parameters:#

NameType
reRegExp

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:237


getTableName#

getTableName(entityName: string): string

Parameters:#

NameType
entityNamestring

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:220


isOneToOneInverse#

isOneToOneInverse(field: string): boolean

Parameters:#

NameType
fieldstring

Returns: boolean

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:213


isPrefixed#

PrivateisPrefixed(field: string): boolean

Parameters:#

NameType
fieldstring

Returns: boolean

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:545


isSimpleRegExp#

isSimpleRegExp(re: any): boolean

Checks whether the RE can be rewritten to simple LIKE query

Parameters:#

NameType
reany

Returns: boolean

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:228


joinManyToManyReference#

joinManyToManyReference(prop: EntityProperty<any>, ownerAlias: string, alias: string, pivotAlias: string, type: leftJoin | innerJoin | pivotJoin, cond: Dictionary<any>, path: string): Dictionary<JoinOptions>

Parameters:#

NameType
propEntityProperty<any>
ownerAliasstring
aliasstring
pivotAliasstring
typeleftJoin | innerJoin | pivotJoin
condDictionary<any>
pathstring

Returns: Dictionary<JoinOptions>

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:146


joinManyToOneReference#

joinManyToOneReference(prop: EntityProperty<any>, ownerAlias: string, alias: string, type: leftJoin | innerJoin | pivotJoin, cond?: Dictionary<any>): JoinOptions

Parameters:#

NameType
propEntityProperty<any>
ownerAliasstring
aliasstring
typeleftJoin | innerJoin | pivotJoin
condDictionary<any>

Returns: JoinOptions

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:137


joinOneToReference#

joinOneToReference(prop: EntityProperty<any>, ownerAlias: string, alias: string, type: leftJoin | innerJoin | pivotJoin, cond?: Dictionary<any>): JoinOptions

Parameters:#

NameType
propEntityProperty<any>
ownerAliasstring
aliasstring
typeleftJoin | innerJoin | pivotJoin
condDictionary<any>

Returns: JoinOptions

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:123


joinPivotTable#

joinPivotTable(field: string, prop: EntityProperty<any>, ownerAlias: string, alias: string, type: leftJoin | innerJoin | pivotJoin, cond?: Dictionary<any>): JoinOptions

Parameters:#

NameType
fieldstring
propEntityProperty<any>
ownerAliasstring
aliasstring
typeleftJoin | innerJoin | pivotJoin
condDictionary<any>

Returns: JoinOptions

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:172


mapJoinColumns#

mapJoinColumns(type: QueryType, join: JoinOptions): (string | Raw<any>)[]

Parameters:#

NameType
typeQueryType
joinJoinOptions

Returns: (string | Raw<any>)[]

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:200


mapper#

mapper(field: string, type?: QueryType): string

Parameters:#

NameType
fieldstring
type?QueryType

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:30

mapper(field: string, type?: QueryType, value?: any, alias?: string): string

Parameters:#

NameType
fieldstring
type?QueryType
value?any
alias?string

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:31


prefix#

Privateprefix(field: string, always?: boolean, quote?: boolean): string

Parameters:#

NameTypeDefault value
fieldstring-
alwaysbooleanfalse
quotebooleanfalse

Returns: string

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:507


processCustomExpression#

PrivateprocessCustomExpression<T>(clause: any, m: string, key: string, cond: any, type?: QueryType): void

Type parameters:#

NameTypeDefault
Tany[]any[]

Parameters:#

NameType
clauseany
mstring
keystring
condany
typeQueryType

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:305


processData#

processData(data: Dictionary<any>, convertCustomTypes: boolean, multi?: boolean): any

Parameters:#

NameTypeDefault value
dataDictionary<any>-
convertCustomTypesboolean-
multibooleanfalse

Returns: any

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:74


processJoins#

processJoins(qb: QueryBuilder<any, any>, joins: Dictionary<JoinOptions>): void

Parameters:#

NameType
qbQueryBuilder<any, any>
joinsDictionary<JoinOptions>

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:184


processObjectSubClause#

PrivateprocessObjectSubClause(cond: any, key: string, clause: JoinClause, m: andOn | orOn): void

Parameters:#

NameType
condany
keystring
clauseJoinClause
mandOn | orOn

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:406


processObjectSubCondition#

PrivateprocessObjectSubCondition(cond: any, key: string, qb: QueryBuilder<any, any>, method: having | where, m: having | where | orWhere, type: QueryType): void

Parameters:#

NameType
condany
keystring
qbQueryBuilder<any, any>
methodhaving | where
mhaving | where | orWhere
typeQueryType

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:320


splitField#

splitField(field: string): [string, string]

Parameters:#

NameType
fieldstring

Returns: [string, string]

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:462


updateVersionProperty#

updateVersionProperty(qb: QueryBuilder<any, any>, data: Dictionary<any>): void

Parameters:#

NameType
qbQueryBuilder<any, any>
dataDictionary<any>

Returns: void

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:486


isCustomExpression#

StaticisCustomExpression(field: string): boolean

Parameters:#

NameType
fieldstring

Returns: boolean

Defined in: packages/knex/src/query/QueryBuilderHelper.ts:503

Last updated on by Renovate Bot