Version: 4.3

Class: MariaDbDriver

Hierarchy

Implements

Constructors

constructor

+ new MariaDbDriver(config: Configuration): MariaDbDriver

Overrides void

Defined in packages/mariadb/src/MariaDbDriver.ts:5

Parameters:

NameType
configConfiguration

Returns: MariaDbDriver

Properties

[EntityManagerType]

[EntityManagerType]: SqlEntityManager<this>

Inherited from MariaDbDriver.[EntityManagerType]

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:9


comparator

Protected comparator: EntityComparator

Inherited from AbstractSqlDriver.comparator

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:19


config

Protected Readonly config: Configuration

Inherited from AbstractSqlDriver.config

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:12


connection

Protected Readonly connection: MariaDbConnection

Inherited from MariaDbDriver.connection

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:10


dependencies

Protected Readonly dependencies: string[]

Inherited from AbstractSqlDriver.dependencies

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:13


logger

Protected Readonly logger: Logger

Inherited from AbstractSqlDriver.logger

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:18


metadata

Protected metadata: MetadataStorage

Inherited from AbstractSqlDriver.metadata

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:20


platform

Protected Readonly platform: AbstractSqlPlatform

Inherited from MariaDbDriver.platform

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:12


replicas

Protected Readonly replicas: MariaDbConnection[]

Inherited from MariaDbDriver.replicas

Overrides MongoDriver.replicas

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:11

Methods

aggregate

aggregate(entityName: string, pipeline: any[]): Promise<any[]>

Inherited from AbstractSqlDriver.aggregate

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:31

Parameters:

NameType
entityNamestring
pipelineany[]

Returns: Promise<any[]>


autoJoinOneToOneOwner

ProtectedautoJoinOneToOneOwner<T>(meta: EntityMetadata, populate: PopulateOptions<T>[], fields?: string[]): PopulateOptions<T>[]

Inherited from MariaDbDriver.autoJoinOneToOneOwner

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:33

1:1 owner side needs to be marked for population so QB auto-joins the owner id

Type parameters:

Name
T

Parameters:

NameType
metaEntityMetadata
populatePopulateOptions<T>[]
fields?string[]

Returns: PopulateOptions<T>[]


buildFields

ProtectedbuildFields<T>(meta: EntityMetadata<T>, populate: PopulateOptions<T>[], joinedProps: PopulateOptions<T>[], qb: QueryBuilder<T>, fields?: Field<T>[]): Field<T>[]

Inherited from MariaDbDriver.buildFields

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:49

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
metaEntityMetadata<T>
populatePopulateOptions<T>[]
joinedPropsPopulateOptions<T>[]
qbQueryBuilder<T>
fields?Field<T>[]

Returns: Field<T>[]


close

close(force?: boolean): Promise<void>

Inherited from AbstractSqlDriver.close

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:38

Parameters:

NameType
force?boolean

Returns: Promise<void>


connect

connect(): Promise<MariaDbConnection>

Inherited from AbstractSqlDriver.connect

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:35

Returns: Promise<MariaDbConnection>


convertException

convertException(exception: Error): DriverException

Inherited from AbstractSqlDriver.convertException

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:56

inheritdoc

Parameters:

NameType
exceptionError

Returns: DriverException


count

count<T>(entityName: string, where: any, options?: CountOptions<T>, ctx?: Transaction<KnexTransaction>): Promise<number>

Inherited from MariaDbDriver.count

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:21

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
whereany
options?CountOptions<T>
ctx?Transaction<KnexTransaction>

Returns: Promise<number>


createEntityManager

createEntityManager<D>(useContext?: boolean): D[typeof EntityManagerType]

Inherited from MariaDbDriver.createEntityManager

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:15

Type parameters:

NameTypeDefault
DIDatabaseDriverIDatabaseDriver

Parameters:

NameType
useContext?boolean

Returns: D[typeof EntityManagerType]


createQueryBuilder

ProtectedcreateQueryBuilder<T>(entityName: string, ctx?: Transaction<KnexTransaction>, write?: boolean, convertCustomTypes?: boolean): QueryBuilder<T>

Inherited from MariaDbDriver.createQueryBuilder

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:44

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
ctx?Transaction<KnexTransaction>
write?boolean
convertCustomTypes?boolean

Returns: QueryBuilder<T>


createReplicas

ProtectedcreateReplicas(cb: (c: ConnectionOptions) => MariaDbConnection): MariaDbConnection[]

Inherited from AbstractSqlDriver.createReplicas

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:47

Parameters:

NameType
cb(c: ConnectionOptions) => MariaDbConnection

Returns: MariaDbConnection[]


ensureIndexes

ensureIndexes(): Promise<void>

Inherited from AbstractSqlDriver.ensureIndexes

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:42

Returns: Promise<void>


execute

execute<T>(queryOrKnex: string | KnexQueryBuilder | Raw, params?: any[], method?: "all" | "get" | "run", ctx?: Transaction): Promise<T>

Inherited from MariaDbDriver.execute

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:29

Type parameters:

NameTypeDefault
TQueryResult | EntityData<AnyEntity> | EntityData<AnyEntity>[]EntityData\<AnyEntity>[]

Parameters:

NameType
queryOrKnexstring | KnexQueryBuilder | Raw
params?any[]
method?"all" | "get" | "run"
ctx?Transaction

Returns: Promise<T>


extractManyToMany

ProtectedextractManyToMany<T>(entityName: string, data: EntityData<T>): EntityData<T>

Inherited from MariaDbDriver.extractManyToMany

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:45

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
dataEntityData<T>

Returns: EntityData<T>


find

find<T>(entityName: string, where: FilterQuery<T>, options?: FindOptions<T>, ctx?: Transaction<KnexTransaction>): Promise<EntityData<T>[]>

Inherited from MariaDbDriver.find

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:16

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
whereFilterQuery<T>
options?FindOptions<T>
ctx?Transaction<KnexTransaction>

Returns: Promise<EntityData<T>[]>


findOne

findOne<T>(entityName: string, where: FilterQuery<T>, options?: FindOneOptions<T>, ctx?: Transaction<KnexTransaction>): Promise<EntityData<T> | null>

Inherited from MariaDbDriver.findOne

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:17

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
whereFilterQuery<T>
options?FindOneOptions<T>
ctx?Transaction<KnexTransaction>

Returns: Promise<EntityData<T> | null>


getConnection

getConnection(type?: "read" | "write"): MariaDbConnection

Inherited from AbstractSqlDriver.getConnection

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:37

Parameters:

NameType
type?"read" | "write"

Returns: MariaDbConnection


getDependencies

getDependencies(): string[]

Inherited from AbstractSqlDriver.getDependencies

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:41

Returns: string[]


getFieldsForJoinedLoad

ProtectedgetFieldsForJoinedLoad<T>(qb: QueryBuilder<T>, meta: EntityMetadata<T>, populate?: PopulateOptions<T>[], parentTableAlias?: string, parentJoinPath?: string): Field<T>[]

Inherited from MariaDbDriver.getFieldsForJoinedLoad

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:39

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
qbQueryBuilder<T>
metaEntityMetadata<T>
populate?PopulateOptions<T>[]
parentTableAlias?string
parentJoinPath?string

Returns: Field<T>[]


getPivotInverseProperty

ProtectedgetPivotInverseProperty(prop: EntityProperty): EntityProperty

Inherited from AbstractSqlDriver.getPivotInverseProperty

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:46

Parameters:

NameType
propEntityProperty

Returns: EntityProperty


getPivotOrderBy

ProtectedgetPivotOrderBy(prop: EntityProperty, orderBy?: QueryOrderMap): QueryOrderMap

Inherited from AbstractSqlDriver.getPivotOrderBy

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:44

Parameters:

NameType
propEntityProperty
orderBy?QueryOrderMap

Returns: QueryOrderMap


getPlatform

getPlatform(): AbstractSqlPlatform

Inherited from MariaDbDriver.getPlatform

Overrides MongoDriver.getPlatform

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:14

Returns: AbstractSqlPlatform


getPrimaryKeyFields

ProtectedgetPrimaryKeyFields(entityName: string): string[]

Inherited from AbstractSqlDriver.getPrimaryKeyFields

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:45

Parameters:

NameType
entityNamestring

Returns: string[]


inlineEmbeddables

ProtectedinlineEmbeddables<T>(meta: EntityMetadata<T>, data: T, where?: boolean): void

Inherited from AbstractSqlDriver.inlineEmbeddables

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:43

Type parameters:

Name
T

Parameters:

NameType
metaEntityMetadata<T>
dataT
where?boolean

Returns: void


joinedProps

ProtectedjoinedProps<T>(meta: EntityMetadata, populate: PopulateOptions<T>[]): PopulateOptions<T>[]

Inherited from MariaDbDriver.joinedProps

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:34

Type parameters:

Name
T

Parameters:

NameType
metaEntityMetadata
populatePopulateOptions<T>[]

Returns: PopulateOptions<T>[]


loadFromPivotTable

loadFromPivotTable<T, O>(prop: EntityProperty, owners: Primary<O>[][], where?: FilterQuery<T>, orderBy?: QueryOrderMap, ctx?: Transaction): Promise<Dictionary<T[]>>

Inherited from MariaDbDriver.loadFromPivotTable

Overrides MongoDriver.loadFromPivotTable

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:28

Type parameters:

NameType
TAnyEntity<T>
OAnyEntity<O>

Parameters:

NameType
propEntityProperty
ownersPrimary<O>[][]
where?FilterQuery<T>
orderBy?QueryOrderMap
ctx?Transaction

Returns: Promise<Dictionary<T[]>>


lockPessimistic

lockPessimistic<T>(entity: T, mode: LockMode, ctx?: Transaction): Promise<void>

Inherited from MariaDbDriver.lockPessimistic

Overrides MongoDriver.lockPessimistic

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:48

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityT
modeLockMode
ctx?Transaction

Returns: Promise<void>


mapPropToFieldNames

mapPropToFieldNames<T>(qb: QueryBuilder<T>, prop: EntityProperty<T>, tableAlias?: string): Field<T>[]

Inherited from MariaDbDriver.mapPropToFieldNames

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:43

internal

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
qbQueryBuilder<T>
propEntityProperty<T>
tableAlias?string

Returns: Field<T>[]


mapResult

mapResult<T>(result: EntityData<T>, meta: EntityMetadata<T>, populate?: PopulateOptions<T>[], qb?: QueryBuilder<T>, map?: Dictionary): EntityData<T> | null

Inherited from MariaDbDriver.mapResult

Overrides MongoDriver.mapResult

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:18

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
resultEntityData<T>
metaEntityMetadata<T>
populate?PopulateOptions<T>[]
qb?QueryBuilder<T>
map?Dictionary

Returns: EntityData<T> | null


mergeJoinedResult

mergeJoinedResult<T>(rawResults: Dictionary[], meta: EntityMetadata<T>): EntityData<T>[]

Inherited from MariaDbDriver.mergeJoinedResult

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:38

internal

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
rawResultsDictionary[]
metaEntityMetadata<T>

Returns: EntityData<T>[]


nativeDelete

nativeDelete<T>(entityName: string, where: FilterQuery<T> | string | any, ctx?: Transaction<KnexTransaction>): Promise<QueryResult>

Inherited from MariaDbDriver.nativeDelete

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:26

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
whereFilterQuery<T> | string | any
ctx?Transaction<KnexTransaction>

Returns: Promise<QueryResult>


nativeInsert

nativeInsert<T>(entityName: string, data: EntityData<T>, ctx?: Transaction<KnexTransaction>, convertCustomTypes?: boolean): Promise<QueryResult>

Inherited from MariaDbDriver.nativeInsert

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:22

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
dataEntityData<T>
ctx?Transaction<KnexTransaction>
convertCustomTypes?boolean

Returns: Promise<QueryResult>


nativeInsertMany

nativeInsertMany<T>(entityName: string, data: EntityData<T>[], ctx?: Transaction<Transaction>, processCollections?: boolean): Promise<QueryResult>

Overrides PostgreSqlDriver.nativeInsertMany

Defined in packages/mariadb/src/MariaDbDriver.ts:11

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameTypeDefault value
entityNamestring-
dataEntityData<T>[]-
ctx?Transaction<Transaction>-
processCollectionsbooleantrue

Returns: Promise<QueryResult>


nativeUpdate

nativeUpdate<T>(entityName: string, where: FilterQuery<T>, data: EntityData<T>, ctx?: Transaction<KnexTransaction>, convertCustomTypes?: boolean): Promise<QueryResult>

Inherited from MariaDbDriver.nativeUpdate

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:24

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
whereFilterQuery<T>
dataEntityData<T>
ctx?Transaction<KnexTransaction>
convertCustomTypes?boolean

Returns: Promise<QueryResult>


nativeUpdateMany

nativeUpdateMany<T>(entityName: string, where: FilterQuery<T>[], data: EntityData<T>[], ctx?: Transaction<KnexTransaction>, processCollections?: boolean, convertCustomTypes?: boolean): Promise<QueryResult>

Inherited from MariaDbDriver.nativeUpdateMany

Overrides void

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:25

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
entityNamestring
whereFilterQuery<T>[]
dataEntityData<T>[]
ctx?Transaction<KnexTransaction>
processCollections?boolean
convertCustomTypes?boolean

Returns: Promise<QueryResult>


processManyToMany

ProtectedprocessManyToMany<T>(meta: EntityMetadata<T> | undefined, pks: Primary<T>[], collections: EntityData<T>, clear: boolean, ctx?: Transaction<KnexTransaction>): Promise<void>

Inherited from MariaDbDriver.processManyToMany

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:46

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
metaEntityMetadata<T> | undefined
pksPrimary<T>[]
collectionsEntityData<T>
clearboolean
ctx?Transaction<KnexTransaction>

Returns: Promise<void>


reconnect

reconnect(): Promise<MariaDbConnection>

Inherited from AbstractSqlDriver.reconnect

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:36

Returns: Promise<MariaDbConnection>


rethrow

Protectedrethrow<T>(promise: Promise<T>): Promise<T>

Inherited from AbstractSqlDriver.rethrow

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:57

Type parameters:

Name
T

Parameters:

NameType
promisePromise<T>

Returns: Promise<T>


setMetadata

setMetadata(metadata: MetadataStorage): void

Inherited from AbstractSqlDriver.setMetadata

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:40

Parameters:

NameType
metadataMetadataStorage

Returns: void


shouldHaveColumn

shouldHaveColumn<T>(prop: EntityProperty<T>, populate: PopulateOptions<T>[], includeFormulas?: boolean): boolean

Inherited from AbstractSqlDriver.shouldHaveColumn

Defined in packages/core/dist/drivers/DatabaseDriver.d.ts:52

internal

Type parameters:

NameType
TAnyEntity<T>

Parameters:

NameType
propEntityProperty<T>
populatePopulateOptions<T>[]
includeFormulas?boolean

Returns: boolean


syncCollection

syncCollection<T, O>(coll: Collection<T, O>, ctx?: Transaction): Promise<void>

Inherited from MariaDbDriver.syncCollection

Overrides MongoDriver.syncCollection

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:27

Type parameters:

NameType
TAnyEntity<T>
OAnyEntity<O>

Parameters:

NameType
collCollection<T, O>
ctx?Transaction

Returns: Promise<void>


updateCollectionDiff

ProtectedupdateCollectionDiff<T, O>(meta: EntityMetadata<O>, prop: EntityProperty<T>, pks: Primary<O>[], deleteDiff: Primary<T>[][] | boolean, insertDiff: Primary<T>[][], ctx?: Transaction): Promise<void>

Inherited from MariaDbDriver.updateCollectionDiff

Defined in packages/knex/dist/AbstractSqlDriver.d.ts:47

Type parameters:

NameType
TAnyEntity<T>
OAnyEntity<O>

Parameters:

NameType
metaEntityMetadata<O>
propEntityProperty<T>
pksPrimary<O>[]
deleteDiffPrimary<T>[][] | boolean
insertDiffPrimary<T>[][]
ctx?Transaction

Returns: Promise<void>

Last updated on by Martin Adámek