@spinajs/orm
Advanced tools
Comparing version 2.0.70 to 2.0.71
@@ -199,21 +199,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
async createConnections() { | ||
const connections = await Promise.all(this.Configuration.get('db.Connections', []) | ||
.map((c) => { | ||
const cConnections = this.Configuration.get('db.Connections', []); | ||
for (const c of cConnections) { | ||
this.Log.trace(`Trying to create connection name: ${c.Name}, driver: ${c.Driver}`); | ||
if (!this.Container.hasRegistered(c.Driver)) { | ||
this.Log.warn(`ORM connection driver ${c.Driver} not registerd`); | ||
throw new OrmException(`ORM connection driver ${c.Driver} not registerd`); | ||
} | ||
this.Log.trace(`Trying to create connection name: ${c.Name}, driver: ${c.Driver}`); | ||
return this.Container.resolve(c.Driver, [c]); | ||
}) | ||
.filter((c) => c !== null) | ||
.map((c) => { | ||
return c.connect().then((d) => { | ||
this.Log.trace(`Connection succesyfully created ${d.Options.Name}`); | ||
return d; | ||
}); | ||
})); | ||
connections.forEach((c) => { | ||
this.Connections.set(c.Options.Name, c); | ||
this.Log.info(`Found ORM driver ${c.Options.Name} with parameters ${JSON.stringify(_.pick(c.Options, CFG_PROPS))}`); | ||
}); | ||
const driver = await this.Container.resolve(c.Driver, [c]); | ||
await driver.connect(); | ||
this.Connections.set(c.Name, driver); | ||
this.Log.success(`Created ORM connection ${c.Name} with parametes ${JSON.stringify(_.pick(c, CFG_PROPS))}`); | ||
} | ||
const defaultConnection = this.Configuration.get('db.DefaultConnection'); | ||
@@ -220,0 +212,0 @@ if (defaultConnection) { |
{ | ||
"name": "@spinajs/orm", | ||
"version": "2.0.70", | ||
"version": "2.0.71", | ||
"description": "framework orm module", | ||
@@ -52,7 +52,7 @@ "exports": "./lib/index.js", | ||
"dependencies": { | ||
"@spinajs/configuration": "^2.0.70", | ||
"@spinajs/di": "^2.0.70", | ||
"@spinajs/exceptions": "^2.0.70", | ||
"@spinajs/log": "^2.0.70", | ||
"@spinajs/reflection": "^2.0.70", | ||
"@spinajs/configuration": "^2.0.71", | ||
"@spinajs/di": "^2.0.71", | ||
"@spinajs/exceptions": "^2.0.71", | ||
"@spinajs/log": "^2.0.71", | ||
"@spinajs/reflection": "^2.0.71", | ||
"glob": "^8.1.0", | ||
@@ -59,0 +59,0 @@ "lodash": "^4.17.21", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
480573
7255
Updated@spinajs/di@^2.0.71
Updated@spinajs/exceptions@^2.0.71
Updated@spinajs/log@^2.0.71
Updated@spinajs/reflection@^2.0.71