MsSqlDriver
Hierarchy
- AbstractSqlDriver<MsSqlConnection>
- MsSqlDriver
Index
Constructors
Properties
Methods
- aggregate
- close
- connect
- convertException
- count
- countVirtual
- createEntityManager
- 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 MsSqlDriver
Properties
inherited[EntityManagerType]
readonlyinheritedconfig
Methods
inheritedaggregate
Parameters
entityName: EntityName
pipeline: any[]
Returns Promise<any[]>
inheritedclose
Parameters
optionalforce: boolean
Returns Promise<void>
inheritedconnect
Parameters
optionaloptions: { skipOnConnect?: boolean }
optionalskipOnConnect: boolean
Returns Promise<MsSqlConnection>
inheritedconvertException
Parameters
exception: Error
Returns DriverException
inheritedcount
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
Parameters
optionaluseContext: boolean
Returns SqlEntityManager<MsSqlDriver>
inheritedexecute
Parameters
query: string | RawQueryFragment | 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
Parameters
entityName: EntityName<T>
where: ObjectQuery<T>
options: FindOptions<T, any, any, any>
Returns Promise<EntityData<T>[]>
inheritedgetConnection
Parameters
type: ConnectionType = 'write'
Returns MsSqlConnection
inheritedgetDependencies
Returns name of the underlying database dependencies (e.g.
mongodbormysql2) for SQL drivers it also returnsknexin the array as connectors are not used directly thereReturns string[]
inheritedgetMetadata
Returns MetadataStorage
getORMClass
Returns Constructor<MsSqlMikroORM<SqlEntityManager<MsSqlDriver>, (string | EntityClass<Partial<any>> | EntitySchema<any, never, EntityCtor<any>>)[]>>
inheritedgetPlatform
Returns AbstractSqlPlatform
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
Parameters
entity: T
options: LockOptions
Returns Promise<void>
inheritedmapResult
Parameters
result: EntityData<T>
meta: EntityMetadata<T, EntityCtor<T>>
populate: PopulateOptions<T>[] = []
optionalqb: QueryBuilder<T, any, any, any>
map: Dictionary = {}
Returns null | EntityData<T>
inheritednativeDelete
Parameters
entityName: EntityName<T>
where: any
options: DeleteOptions<T> = {}
Returns Promise<QueryResult<T>>
inheritednativeInsert
Parameters
entityName: EntityName<T>
data: EntityDictionary<T>
options: NativeInsertUpdateOptions<T> = {}
Returns Promise<QueryResult<T>>
nativeInsertMany
Parameters
entityName: EntityName<T>
data: EntityDictionary<T>[]
options: NativeInsertUpdateManyOptions<T> = {}
Returns Promise<QueryResult<T>>
inheritednativeUpdate
Parameters
entityName: EntityName<T>
where: FilterQuery<T>
data: EntityDictionary<T>
options: NativeInsertUpdateOptions<T> & UpsertOptions<T, never> = {}
Returns Promise<QueryResult<T>>
inheritednativeUpdateMany
Parameters
entityName: EntityName<T>
where: FilterQuery<T>[]
data: EntityDictionary<T>[]
options: NativeInsertUpdateManyOptions<T> & UpsertManyOptions<T, never> = {}
Returns Promise<QueryResult<T>>
inheritedreconnect
Parameters
optionaloptions: { skipOnConnect?: boolean }
optionalskipOnConnect: boolean
Returns Promise<MsSqlConnection>
inheritedsetMetadata
Parameters
metadata: MetadataStorage
Returns void
inheritedstream
Parameters
entityName: EntityName<T>
where: FilterQuery<T>
options: StreamOptions<T, any, any, any>
Returns AsyncIterableIterator<T, any, any>
inheritedsyncCollections
Parameters
collections: Iterable<Collection<T, O>, any, any>
optionaloptions: DriverMethodOptions
Returns Promise<void>
Converts native db errors to standardized driver exceptions