Skip to main content
Version: 5.2

abstractAbstractSqlDriver <C>

Hierarchy

Index

Properties

[EntityManagerType]

[EntityManagerType]: SqlEntityManager<AbstractSqlDriver<C>>

readonlyconfig

Methods

aggregate

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

    • entityName: string
    • pipeline: any[]

    Returns Promise<any[]>

close

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

    • optionalforce: boolean

    Returns Promise<void>

connect

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

convertException

  • Converts native db errors to standardized driver exceptions


    Parameters

    • exception: Error

    Returns DriverException

count

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

    Parameters

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

    Returns Promise<number>

createEntityManager

ensureIndexes

  • ensureIndexes(): Promise<void>
  • Returns Promise<void>

execute

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

find

  • Finds selection of entities


    Type parameters

    • T
    • P: string = never

    Parameters

    Returns Promise<EntityData<T>[]>

findOne

  • Finds single entity (table row, document)


    Type parameters

    • T
    • P: string = never

    Parameters

    Returns Promise<null | EntityData<T>>

getConnection

  • Parameters

    Returns C

getDependencies

  • 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[]

getMetadata

getPlatform

loadFromPivotTable

  • When driver uses pivot tables for M:N, this method will load identifiers for given collections from them


    Type parameters

    • T
    • O

    Parameters

    Returns Promise<Dictionary<T[]>>

lockPessimistic

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

    Parameters

    Returns Promise<void>

mapResult

nativeDelete

  • Type parameters

    Parameters

    Returns Promise<QueryResult<T>>

nativeInsert

nativeInsertMany

nativeUpdate

nativeUpdateMany

reconnect

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

setMetadata

  • Parameters

    Returns void

syncCollection