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;
}
-
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.
Helper function to handle both the configuration and initialization of a typeORM datasource. Uses createConnectionOptions to handle the configuration.