UNPKG

typeorm

Version:

Data-Mapper ORM for TypeScript, ES7, ES6, ES5. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, MongoDB databases.

65 lines (64 loc) 2.24 kB
import { ConnectionOptions } from "./ConnectionOptions"; /** * Reads connection options from the ormconfig. * Can read from multiple file extensions including env, json, js, xml and yml. */ export declare class ConnectionOptionsReader { protected options?: { /** * Directory where ormconfig should be read from. * By default its your application root (where your app package.json is located). */ root?: string | undefined; /** * Filename of the ormconfig configuration. By default its equal to "ormconfig". */ configName?: string | undefined; } | undefined; constructor(options?: { /** * Directory where ormconfig should be read from. * By default its your application root (where your app package.json is located). */ root?: string | undefined; /** * Filename of the ormconfig configuration. By default its equal to "ormconfig". */ configName?: string | undefined; } | undefined); /** * Returns all connection options read from the ormconfig. */ all(): Promise<ConnectionOptions[]>; /** * Gets a connection with a given name read from ormconfig. * If connection with such name would not be found then it throw error. */ get(name: string): Promise<ConnectionOptions>; /** * Checks if there is a TypeORM configuration file. */ has(name: string): Promise<boolean>; /** * Loads all connection options from a configuration file. * * todo: get in count NODE_ENV somehow */ protected load(): Promise<ConnectionOptions[] | undefined>; /** * Normalize connection options. */ protected normalizeConnectionOptions(connectionOptions: ConnectionOptions | ConnectionOptions[]): ConnectionOptions[]; /** * Gets directory where configuration file should be located and configuration file name. */ protected get baseFilePath(): string; /** * Gets directory where configuration file should be located. */ protected get baseDirectory(): string; /** * Gets configuration file name. */ protected get baseConfigName(): string; }