MariaDbDriver
Hierarchy
- MySqlDriver
- MariaDbDriver
Index
Constructors
Properties
Methods
- aggregate
- close
- connect
- convertException
- count
- countVirtual
- createEntityManager
- evaluateFormula
- execute
- find
- findOne
- findVirtual
- getConnection
- getDependencies
- getMetadata
- getORMClass
- getPlatform
- loadFromPivotTable
- lockPessimistic
- mapResult
- nativeDelete
- nativeInsert
- nativeInsertMany
- nativeUpdate
- nativeUpdateMany
- reconnect
- setMetadata
- stream
- syncCollections
Constructors
constructor
Parameters
Returns MariaDbDriver
Properties
inherited[EntityManagerType]
readonlyinheritedconfig
readonlyplatform
Methods
inheritedaggregate
Executes a MongoDB aggregation pipeline (MongoDB driver only).
Parameters
entityName: EntityName
pipeline: any[]
Returns Promise<any[]>
inheritedclose
Closes the primary connection and all read replicas.
Parameters
optionalforce: boolean
Returns Promise<void>
inheritedconnect
Opens the primary connection and all read replicas.
Parameters
optionaloptions: { skipOnConnect?: boolean }
optionalskipOnConnect: boolean
Returns Promise<MySqlConnection>
inheritedconvertException
Converts native db errors to standardized driver exceptions
Parameters
exception: Error
Returns DriverException
inheritedcount
Counts entities matching the given condition.
Parameters
entityName: EntityName<T>
where: any
options: CountOptions<T, never> = {}
Returns Promise<number>
inheritedcountVirtual
Parameters
entityName: EntityName<T>
where: ObjectQuery<T>
options: CountOptions<T, any>
Returns Promise<number>
inheritedcreateEntityManager
Creates a new EntityManager instance bound to this driver.
Parameters
optionaluseContext: boolean
Returns SqlEntityManager<MariaDbDriver>
inheritedevaluateFormula
Evaluates a formula callback, handling both string and Raw return values.
Parameters
formula: (...args) => string | RawQueryFragment<string>
columns: any
table: FormulaTable
Returns string
inheritedexecute
Parameters
query: string | RawQueryFragment<string> | NativeQueryBuilder
params: any[] = []
method: get | all | run = 'all'
optionalctx: any
optionalloggerContext: LoggingOptions
Returns Promise<T>
inheritedfind
Finds selection of entities
Parameters
entityName: EntityName<T>
where: ObjectQuery<T>
options: FindOptions<T, P, F, E> = {}
Returns Promise<EntityData<T>[]>
inheritedfindOne
Finds single entity (table row, document)
Parameters
entityName: EntityName<T>
where: ObjectQuery<T>
optionaloptions: FindOneOptions<T, P, F, E>
Returns Promise<null | EntityData<T>>
inheritedfindVirtual
Finds entities backed by a virtual (expression-based) definition.
Parameters
entityName: EntityName<T>
where: ObjectQuery<T>
options: FindOptions<T, any, any, any>
Returns Promise<EntityData<T>[]>
inheritedgetConnection
Returns the write connection or a random read replica.
Parameters
type: ConnectionType = 'write'
Returns MySqlConnection
inheritedgetDependencies
Returns the names of native database dependencies required by this driver.
Returns string[]
inheritedgetMetadata
Returns the metadata storage used by this driver.
Returns MetadataStorage
getORMClass
Returns Constructor<MariaDbMikroORM<SqlEntityManager<MariaDbDriver>, (string | EntitySchema<any, never, EntityCtor<any>> | EntityClass<Partial<any>>)[]>>
inheritedgetPlatform
Returns the database platform abstraction for this driver.
Returns MySqlPlatform
inheritedloadFromPivotTable
When driver uses pivot tables for M:N, this method will load identifiers for given collections from them
Parameters
prop: EntityProperty<any, any>
owners: (O extends { [PrimaryKeyProp]?: PK } ? PK extends undefined ? Omit<O<O>, typeof PrimaryKeyProp> : PK extends keyof O<O> ? ReadonlyPrimary<UnwrapPrimary<O<O>[PK<PK>]>> : PK extends keyof O<O>[] ? ReadonlyPrimary<PrimaryPropToType<O<O>, PK<PK>>> : PK : O extends { _id?: PK } ? string | ReadonlyPrimary<PK> : O extends { id?: PK } ? ReadonlyPrimary<PK> : O extends { uuid?: PK } ? ReadonlyPrimary<PK> : O)[][]
where: any = ...
optionalorderBy: OrderDefinition<T>
optionalctx: any
optionaloptions: FindOptions<T, any, any, any>
optionalpivotJoin: boolean
Returns Promise<Dictionary<T[]>>
inheritedlockPessimistic
Acquires a pessimistic lock on the given entity.
Parameters
entity: T
options: LockOptions
Returns Promise<void>
inheritedmapResult
Maps raw database result to entity data, converting column names to property names.
Parameters
result: EntityData<T>
meta: EntityMetadata<T, EntityCtor<T>>
populate: PopulateOptions<T>[] = []
optionalqb: AnyQueryBuilder<T>
map: Dictionary = {}
Returns null | EntityData<T>
inheritednativeDelete
Deletes rows matching the given condition.
Parameters
entityName: EntityName<T>
where: any
options: DeleteOptions<T> = {}
Returns Promise<QueryResult<T>>
inheritednativeInsert
Inserts a single row into the database.
Parameters
entityName: EntityName<T>
data: EntityDictionary<T>
options: NativeInsertUpdateOptions<T> = {}
Returns Promise<QueryResult<T>>
inheritednativeInsertMany
Inserts multiple rows into the database in a single batch operation.
Parameters
entityName: EntityName<T>
data: EntityDictionary<T>[]
options: NativeInsertUpdateManyOptions<T> = {}
Returns Promise<QueryResult<T>>
inheritednativeUpdate
Updates rows matching the given condition.
Parameters
entityName: EntityName<T>
where: FilterQuery<T>
data: EntityDictionary<T>
options: NativeInsertUpdateOptions<T> & UpsertOptions<T, never> = {}
Returns Promise<QueryResult<T>>
inheritednativeUpdateMany
Updates multiple rows with different payloads in a single batch operation.
Parameters
entityName: EntityName<T>
where: FilterQuery<T>[]
data: EntityDictionary<T>[]
options: NativeInsertUpdateManyOptions<T> & UpsertManyOptions<T, never> = {}
Returns Promise<QueryResult<T>>
inheritedreconnect
Closes all connections and re-establishes them.
Parameters
optionaloptions: { skipOnConnect?: boolean }
optionalskipOnConnect: boolean
Returns Promise<MySqlConnection>
inheritedsetMetadata
Sets the metadata storage and initializes the comparator for all connections.
Parameters
metadata: MetadataStorage
Returns void
inheritedstream
Returns an async iterator that streams query results one entity at a time.
Parameters
entityName: EntityName<T>
where: FilterQuery<T>
options: StreamOptions<T, any, any, any>
Returns AsyncIterableIterator<T, any, any>
inheritedsyncCollections
Persists changes to M:N collections (inserts/deletes pivot table rows).
Parameters
collections: Iterable<Collection<T, O>, any, any>
optionaloptions: DriverMethodOptions
Returns Promise<void>
Database driver for MariaDB, extending the MySQL driver with MariaDB-specific behavior.