333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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 readonly baseFilePath: string;
    /**
     * Gets directory where configuration file should be located.
     */
    protected readonly baseDirectory: string;
    /**
     * Gets configuration file name.
     */
    protected readonly baseConfigName: string;
}