跳到主要内容
版本:Next

SequelizeDataSourceManager

Hierarchy

  • DataSourceManager<Sequelize>
    • SequelizeDataSourceManager

Index

Constructors

constructor

Properties

baseDir

baseDir: string

coreLogger

coreLogger: ILogger

sequelizeConfig

sequelizeConfig: any

Methods

createInstance

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

getAllDataSources

  • getAllDataSources(): Map<string, Sequelize>

getDataSource

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

getDataSourceNameByModel

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

getDataSourceNames

  • getDataSourceNames(): string[]

getDataSourcePriority

  • getDataSourcePriority(name: string): string

getDefaultDataSourceName

  • getDefaultDataSourceName(): string

getName

  • getName(): string

hasDataSource

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

init

  • init(): Promise<void>

isConnected

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

isHighPriority

  • isHighPriority(name: string): boolean

isLowPriority

  • isLowPriority(name: string): boolean

isMediumPriority

  • isMediumPriority(name: string): boolean

stop

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