Skip to main content
Version: Next

abstractAbstractSqlDriver <Connection, Platform>

Hierarchy

Index

Properties

[EntityManagerType]

[EntityManagerType]: SqlEntityManager<AbstractSqlDriver<Connection, Platform>>

readonlyinheritedconfig

Methods

inheritedaggregate

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

    • entityName: string
    • pipeline: any[]

    Returns Promise<any[]>

inheritedclose

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

    • optionalforce: boolean

    Returns Promise<void>

inheritedconnect

  • connect(): Promise<Connection>
  • Returns Promise<Connection>

inheritedconvertException

  • Converts native db errors to standardized driver exceptions


    Parameters

    • exception: Error

    Returns DriverException

count

  • count(entityName: string, where: any, options?: CountOptions<T, never>): Promise<number>
  • Parameters

    • entityName: string
    • where: any
    • options: CountOptions<T, never> = {}

    Returns Promise<number>

countVirtual

  • Parameters

    Returns Promise<number>

createEntityManager

  • Parameters

    • optionaluseContext: boolean

    Returns D[typeof EntityManagerType]

execute

  • execute(queryOrKnex: string | QueryBuilder<any, any> | Raw<any>, params?: any[], method?: get | all | run, ctx?: any, loggerContext?: LoggingOptions): Promise<T>
  • Parameters

    • queryOrKnex: string | QueryBuilder<any, any> | Raw<any>
    • params: any[] = []
    • method: get | all | run = 'all'
    • optionalctx: any
    • optionalloggerContext: LoggingOptions

    Returns Promise<T>

find

  • Finds selection of entities


    Parameters

    Returns Promise<EntityData<T>[]>

findOne

  • Finds single entity (table row, document)


    Parameters

    Returns Promise<null | EntityData<T>>

findVirtual

inheritedgetConnection

  • Parameters

    Returns Connection

inheritedgetDependencies

  • getDependencies(): string[]
  • Returns name of the underlying database dependencies (e.g. mongodb or mysql2) for SQL drivers it also returns knex in the array as connectors are not used directly there


    Returns string[]

inheritedgetMetadata

getPlatform

  • getPlatform(): Platform
  • Returns Platform

loadFromPivotTable

  • loadFromPivotTable(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, orderBy?: OrderDefinition<T>, ctx?: any, options?: FindOptions<T, any, any, any>, pivotJoin?: boolean): Promise<Dictionary<T[]>>
  • 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[]>>

lockPessimistic

  • lockPessimistic(entity: T, options: LockOptions): Promise<void>
  • Parameters

    Returns Promise<void>

mapResult

nativeDelete

  • Parameters

    Returns Promise<QueryResult<T>>

nativeInsert

nativeInsertMany

nativeUpdate

nativeUpdateMany

inheritedreconnect

  • reconnect(): Promise<Connection>
  • Returns Promise<Connection>

inheritedsetMetadata

  • Parameters

    Returns void

syncCollections

  • Parameters

    Returns Promise<void>