abstractDatabaseDriver <C>
Hierarchy
- DatabaseDriver
Implements
Index
Properties
Methods
Properties
[EntityManagerType]
readonlyconfig
Methods
aggregate
Parameters
entityName: string
pipeline: any[]
Returns Promise<any[]>
close
Parameters
optionalforce: boolean
Returns Promise<void>
connect
Returns Promise<C>
convertException
Parameters
exception: Error
Returns DriverException
abstractcount
Parameters
entityName: string
where: FilterQuery<T>
optionaloptions: CountOptions<T, P>
Returns Promise<number>
countVirtual
Parameters
entityName: string
where: FilterQuery<T>
options: CountOptions<T, any>
Returns Promise<number>
createEntityManager
Parameters
optionaluseContext: boolean
Returns D[typeof EntityManagerType]
abstractfind
Finds selection of entities
Parameters
entityName: string
where: FilterQuery<T>
optionaloptions: FindOptions<T, P, F, E>
Returns Promise<EntityData<T>[]>
abstractfindOne
Finds single entity (table row, document)
Parameters
entityName: string
where: FilterQuery<T>
optionaloptions: FindOneOptions<T, P, F, E>
Returns Promise<null | EntityData<T>>
findVirtual
Parameters
entityName: string
where: FilterQuery<T>
options: FindOptions<T, any, any, any>
Returns Promise<EntityData<T>[]>
getConnection
Parameters
type: ConnectionType = 'write'
Returns C
getDependencies
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[]
getMetadata
Returns MetadataStorage
getPlatform
Returns Platform
loadFromPivotTable
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)[][]
optionalwhere: any
optionalorderBy: OrderDefinition<T>
optionalctx: any
optionaloptions: FindOptions<T, any, any, any>
optionalpivotJoin: boolean
Returns Promise<Dictionary<T[]>>
lockPessimistic
Parameters
entity: T
options: LockOptions
Returns Promise<void>
mapResult
Parameters
result: EntityDictionary<T>
optionalmeta: EntityMetadata<T>
populate: PopulateOptions<T>[] = []
Returns null | EntityData<T>
abstractnativeDelete
Parameters
entityName: string
where: FilterQuery<T>
optionaloptions: DeleteOptions<T>
Returns Promise<QueryResult<T>>
abstractnativeInsert
Parameters
entityName: string
data: EntityDictionary<T>
optionaloptions: NativeInsertUpdateOptions<T>
Returns Promise<QueryResult<T>>
abstractnativeInsertMany
Parameters
entityName: string
data: EntityDictionary<T>[]
optionaloptions: NativeInsertUpdateManyOptions<T>
optionaltransform: (sql: string) => string
Returns Promise<QueryResult<T>>
abstractnativeUpdate
Parameters
entityName: string
where: FilterQuery<T>
data: EntityDictionary<T>
optionaloptions: NativeInsertUpdateOptions<T>
Returns Promise<QueryResult<T>>
nativeUpdateMany
Parameters
entityName: string
where: FilterQuery<T>[]
data: EntityDictionary<T>[]
optionaloptions: NativeInsertUpdateManyOptions<T>
Returns Promise<QueryResult<T>>
reconnect
Returns Promise<C>
setMetadata
Parameters
metadata: MetadataStorage
Returns void
syncCollections
Parameters
collections: Iterable<Collection<T, O>, any, any>
optionaloptions: DriverMethodOptions
Returns Promise<void>
Converts native db errors to standardized driver exceptions