MySqlDriver
Hierarchy
- AbstractSqlDriver<MySqlConnection, MySqlPlatform>
- MySqlDriver
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
Returns MySqlDriver
Properties
inherited[EntityManagerType]
readonlyinheritedconfig
Methods
inheritedaggregate
Parameters
entityName: string
pipeline: any[]
Returns Promise<any[]>
inheritedclose
Parameters
optionalforce: boolean
Returns Promise<void>
inheritedconnect
Returns Promise<MySqlConnection>
inheritedconvertException
Parameters
exception: Error
Returns DriverException
inheritedcount
Parameters
entityName: string
where: any
options: CountOptions<T, never> = {}
Returns Promise<number>
inheritedcountVirtual
Parameters
entityName: string
where: FilterQuery<T>
options: CountOptions<T, any>
Returns Promise<number>
inheritedcreateEntityManager
Parameters
optionaluseContext: boolean
Returns D[typeof EntityManagerType]
inheritedexecute
Parameters
queryOrKnex: string | QueryBuilder<any, any> | Raw<any>
params: any[] = []
method: get | all | run = 'all'
optionalctx: any
optionalloggerContext: LoggingOptions
Returns Promise<T>
inheritedfind
Finds selection of entities
Parameters
entityName: string
where: FilterQuery<T>
options: FindOptions<T, P, F, E> = {}
Returns Promise<EntityData<T>[]>
inheritedfindOne
Finds single entity (table row, document)
Parameters
entityName: string
where: FilterQuery<T>
optionaloptions: FindOneOptions<T, P, F, E>
Returns Promise<null | EntityData<T>>
inheritedfindVirtual
Parameters
entityName: string
where: FilterQuery<T>
options: FindOptions<T, any, any, any>
Returns Promise<EntityData<T>[]>
inheritedgetConnection
Parameters
type: ConnectionType = 'write'
Returns MySqlConnection
inheritedgetDependencies
Returns name of the underlying database dependencies (e.g.
mongodb
ormysql2
) for SQL drivers it also returnsknex
in the array as connectors are not used directly thereReturns string[]
inheritedgetMetadata
Returns MetadataStorage
inheritedgetPlatform
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 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 { uuid?: PK } ? ReadonlyPrimary<PK> : O extends { id?: PK } ? ReadonlyPrimary<PK> : O)[][]
where: any = ...
optionalorderBy: OrderDefinition<T>
optionalctx: any
optionaloptions: FindOptions<T, any, any, any>
optionalpivotJoin: boolean
Returns Promise<Dictionary<T[]>>
inheritedlockPessimistic
Parameters
entity: T
options: LockOptions
Returns Promise<void>
inheritedmapResult
Parameters
result: EntityData<T>
meta: EntityMetadata<T>
populate: PopulateOptions<T>[] = []
optionalqb: QueryBuilder<T, any, any, any>
map: Dictionary = {}
Returns null | EntityData<T>
inheritednativeDelete
Parameters
entityName: string
where: any
options: DeleteOptions<T> = {}
Returns Promise<QueryResult<T>>
inheritednativeInsert
Parameters
entityName: string
data: EntityDictionary<T>
options: NativeInsertUpdateOptions<T> = {}
Returns Promise<QueryResult<T>>
nativeInsertMany
Parameters
entityName: string
data: EntityDictionary<T>[]
options: NativeInsertUpdateManyOptions<T> = {}
Returns Promise<QueryResult<T>>
inheritednativeUpdate
Parameters
entityName: string
where: FilterQuery<T>
data: EntityDictionary<T>
options: NativeInsertUpdateOptions<T> & UpsertOptions<T, never> = {}
Returns Promise<QueryResult<T>>
nativeUpdateMany
Parameters
entityName: string
where: FilterQuery<T>[]
data: EntityDictionary<T>[]
options: NativeInsertUpdateManyOptions<T> & UpsertManyOptions<T, never> = {}
Returns Promise<QueryResult<T>>
inheritedreconnect
Returns Promise<MySqlConnection>
inheritedsetMetadata
Parameters
metadata: MetadataStorage
Returns void
inheritedsyncCollections
Parameters
collections: Iterable<Collection<T, O>, any, any>
optionaloptions: DriverMethodOptions
Returns Promise<void>
Converts native db errors to standardized driver exceptions