• Helper function to handle both the configuration and initialization of a typeORM datasource. Uses createConnectionOptions to handle the configuration.

    Parameters

    • dbConfig: {
          database: string;
          host: string;
          password: string;
          port: number;
          schema: string;
          ssl: {
              ca: string;
              cert: string;
              enabled: true;
              key: string;
          } | {
              ca?: string;
              cert?: string;
              enabled: false;
              key?: string;
          };
          username: string;
      }

      The typeorm postgres configuration with added SSL options.

      • database: string
      • host: string
      • password: string
      • port: number
      • schema: string
      • ssl: {
            ca: string;
            cert: string;
            enabled: true;
            key: string;
        } | {
            ca?: string;
            cert?: string;
            enabled: false;
            key?: string;
        }
      • username: string

    Returns Promise<DataSource>

    Ready to use typeorm DataSource.

Generated using TypeDoc