Class DatabaseRegistry

Class to register a new database and resolve a schema/type to a database.

Hierarchy

  • DatabaseRegistry

Constructors

  • Parameters

    • injectorContext: InjectorContext
    • databaseTypes: {
          classType: ClassType<Database<any>>;
          module: InjectorModule<any, InjectorModule<any, any>>;
      }[] = []
    • migrateOnStartup: boolean = false

    Returns DatabaseRegistry

Properties

databaseMap: Map<ClassType<any>, Database<any>> = ...
databaseNameMap: Map<string, Database<any>> = ...
databaseOptions: Map<ClassType<any>, {
    migrateOnStartup?: boolean;
}> = ...
databaseTypes: {
    classType: ClassType<Database<any>>;
    module: InjectorModule<any, InjectorModule<any, any>>;
}[] = []
databases: Database<any>[] = []
initialized: boolean = false
injectorContext: InjectorContext
migrateOnStartup: boolean = false

Methods

  • Parameters

    • database: ClassType<any>
    • options: {
          migrateOnStartup?: boolean;
      } = {}
      • Optional migrateOnStartup?: boolean
    • module: InjectorModule<any, InjectorModule<any, any>>

    Returns void

  • Returns {
        classType: ClassType<Database<any>>;
        module: InjectorModule<any, InjectorModule<any, any>>;
    }[]

  • Reads database from a path. Imports the given paths and looks for instantiated Database classes. All instantiated Database classes will be returned.

    This is an alternative way to find Database and entities compared to a config file driven way.

    Parameters

    • paths: string[]

    Returns void

Generated using TypeDoc