跳到主要内容
版本:Next

abstractDataSourceManager <T, ConnectionOpts, ENTITY_CONFIG_KEY>

Implements

Index

Constructors

constructor

  • new DataSourceManager<T, ConnectionOpts, ENTITY_CONFIG_KEY>(): DataSourceManager<T, ConnectionOpts, ENTITY_CONFIG_KEY>

Methods

publiccreateInstance

  • createInstance(config: ConnectionOpts): Promise<void | T>
  • createInstance(config: ConnectionOpts, clientName: string, 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

staticformatGlobString

  • formatGlobString(globString: string): string[]

staticglobModels

  • globModels(globString: string, baseDir: string, loadMode?: ModuleLoadType): Promise<any[]>