(
protected readonly config: Configuration,
options?: ConnectionOptions,
protected readonly type: ConnectionType = 'write',
)
| 33 | } |
| 34 | |
| 35 | constructor( |
| 36 | protected readonly config: Configuration, |
| 37 | options?: ConnectionOptions, |
| 38 | protected readonly type: ConnectionType = 'write', |
| 39 | ) { |
| 40 | this.logger = this.config.getLogger(); |
| 41 | this.platform = this.config.getPlatform(); |
| 42 | |
| 43 | if (options) { |
| 44 | this.options = Utils.copy(options); |
| 45 | } else { |
| 46 | const props = [ |
| 47 | 'dbName', |
| 48 | 'clientUrl', |
| 49 | 'host', |
| 50 | 'port', |
| 51 | 'user', |
| 52 | 'password', |
| 53 | 'multipleStatements', |
| 54 | 'pool', |
| 55 | 'schema', |
| 56 | 'driverOptions', |
| 57 | ] as const; |
| 58 | this.options = props.reduce((o, i) => { |
| 59 | (o[i] as any) = this.config.get(i); |
| 60 | return o; |
| 61 | }, {} as ConnectionOptions); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Establishes connection to database |
nothing calls this directly
no test coverage detected