跳到主要内容
版本:Next

abstractDataSourceManager <T, ConnectionOpts>

Index

Constructors

constructor

  • Type parameters

    • T
    • ConnectionOpts: Record<string, any> = Record<string, any>

Methods

publiccreateInstance

  • createInstance(config: any, clientName: any, options?: { cacheInstance?: boolean; validateConnection?: boolean }): Promise<void | T>

publicgetAllDataSources

  • getAllDataSources(): Map<string, T>

publicgetDataSource

  • getDataSource(dataSourceName: string): T
  • get a data source instance

publicgetDataSourceNameByModel

  • getDataSourceNameByModel(modelOrRepository: any): string
  • get data source name by model or repository

publicgetDataSourceNames

  • getDataSourceNames(): string[]

publicgetDataSourcePriority

  • getDataSourcePriority(name: string): string

publicgetDefaultDataSourceName

  • getDefaultDataSourceName(): string

publicabstractgetName

  • getName(): string

publichasDataSource

  • hasDataSource(dataSourceName: string): boolean
  • check data source has exists

publicisConnected

  • isConnected(dataSourceName: string): Promise<boolean>
  • check the data source is connected

publicisHighPriority

  • isHighPriority(name: string): boolean

publicisLowPriority

  • isLowPriority(name: string): boolean

publicisMediumPriority

  • isMediumPriority(name: string): boolean

publicstop

  • stop(): Promise<void>
  • Call destroyDataSource() on all data sources