|
|
@ -22,7 +22,14 @@ export class DatabaseService<M extends Microservice = Microservice> extends Inte |
|
|
|
/** |
|
|
|
* The active database connection |
|
|
|
*/ |
|
|
|
protected connection!: Connection; |
|
|
|
public connection!: Connection; |
|
|
|
|
|
|
|
/** |
|
|
|
* The function used to create the connection |
|
|
|
* This is important because inheriting this service to provide custom entity types will not get |
|
|
|
* the connection stored in the correct connection manager without overriding this explicitly. |
|
|
|
*/ |
|
|
|
protected createConnection = createConnection; |
|
|
|
|
|
|
|
/** |
|
|
|
* The database entities |
|
|
@ -61,7 +68,7 @@ export class DatabaseService<M extends Microservice = Microservice> extends Inte |
|
|
|
entities: EntitySchemaTypes[]) |
|
|
|
{ |
|
|
|
// Create the database connection
|
|
|
|
return await createConnection({ |
|
|
|
return await this.createConnection({ |
|
|
|
type : type, |
|
|
|
host : host, |
|
|
|
port : port, |
|
|
|