API 参考
    正在准备搜索索引...

    Reads connection options from the ormconfig.

    索引

    构造函数

    • 参数

      • 可选options: { configName?: string; root?: string }
        • 可选configName?: string

          Filename of the ormconfig configuration. By default its equal to "ormconfig".

        • 可选root?: string

          Directory where ormconfig should be read from. By default its your application root (where your app package.json is located).

      返回 ConnectionOptionsReader

    属性

    options?: { configName?: string; root?: string }

    类型声明

    • 可选configName?: string

      Filename of the ormconfig configuration. By default its equal to "ormconfig".

    • 可选root?: string

      Directory where ormconfig should be read from. By default its your application root (where your app package.json is located).

    访问器

    • get baseConfigName(): string

      Gets configuration file name.

      返回 string

    • get baseDirectory(): string

      Gets directory where configuration file should be located.

      返回 string

    • get baseFilePath(): string

      Gets directory where configuration file should be located and configuration file name.

      返回 string

    方法

    • Returns all connection options read from the ormconfig.

      返回 Promise<DataSourceOptions[]>

    • Gets a connection with a given name read from ormconfig. If connection with such name would not be found then it throw error.

      参数

      • name: string

      返回 Promise<DataSourceOptions>

    • Checks if there is a TypeORM configuration file.

      参数

      • name: string

      返回 Promise<boolean>

    • Loads all connection options from a configuration file.

      todo: get in count NODE_ENV somehow

      返回 Promise<undefined | DataSourceOptions[]>