cormo
Advanced tools
Comparing version 0.12.3 to 0.12.4
@@ -683,3 +683,3 @@ "use strict"; | ||
try { | ||
const client = await mongodb.MongoClient.connect(url, { useNewUrlParser: true }); | ||
const client = await mongodb.MongoClient.connect(url, { useNewUrlParser: true, useUnifiedTopology: true }); | ||
this._client = client; | ||
@@ -686,0 +686,0 @@ this._db = client.db(settings.database); |
@@ -165,3 +165,7 @@ /// <reference types="node" /> | ||
*/ | ||
fetchAssociated(records: any, column: any, select?: any, options?: any): Promise<void>; | ||
fetchAssociated(records: any, column: string, select?: string, options?: { | ||
lean?: boolean; | ||
model?: typeof BaseModel; | ||
transaction?: Transaction; | ||
}): Promise<void>; | ||
/** | ||
@@ -168,0 +172,0 @@ * Applies pending associations |
@@ -401,3 +401,3 @@ "use strict"; | ||
options = select; | ||
select = null; | ||
select = undefined; | ||
} | ||
@@ -413,10 +413,3 @@ else if (options == null) { | ||
let association; | ||
if (options.target_model) { | ||
association = { | ||
foreign_key: options.foreign_key, | ||
target_model: options.target_model, | ||
type: options.type || 'belongsTo', | ||
}; | ||
} | ||
else if (options.model) { | ||
if (options.model) { | ||
association = options.model._associations && options.model._associations[column]; | ||
@@ -899,2 +892,5 @@ } | ||
const query = target_model.where({ id: ids }); | ||
if (options.transaction) { | ||
query.transaction(options.transaction); | ||
} | ||
if (select) { | ||
@@ -937,2 +933,5 @@ query.select(select); | ||
const query = target_model.find(id); | ||
if (options.transaction) { | ||
query.transaction(options.transaction); | ||
} | ||
if (select) { | ||
@@ -989,2 +988,5 @@ query.select(select); | ||
const query = target_model.where(lodash_1.default.zipObject([foreign_key], [{ $in: ids }])); | ||
if (options.transaction) { | ||
query.transaction(options.transaction); | ||
} | ||
if (select) { | ||
@@ -1018,2 +1020,5 @@ query.select(select + ' ' + foreign_key); | ||
const query = target_model.where(lodash_1.default.zipObject([foreign_key], [records.id])); | ||
if (options.transaction) { | ||
query.transaction(options.transaction); | ||
} | ||
if (select) { | ||
@@ -1020,0 +1025,0 @@ query.select(select + ' ' + foreign_key); |
@@ -193,3 +193,3 @@ /// <reference types="node" /> | ||
*/ | ||
include(column: any, select: any): this; | ||
include(column: string, select?: string): this; | ||
transaction(transaction?: Transaction): this; | ||
@@ -196,0 +196,0 @@ /** |
@@ -484,2 +484,3 @@ "use strict"; | ||
model: this._model, | ||
transaction: this._options.transaction, | ||
}); | ||
@@ -486,0 +487,0 @@ })); |
{ | ||
"name": "cormo", | ||
"description": "ORM framework for Node.js", | ||
"version": "0.12.3", | ||
"version": "0.12.4", | ||
"keywords": [ | ||
@@ -37,3 +37,3 @@ "orm", | ||
"chalk": "^2.4.2", | ||
"commander": "^2.20.0", | ||
"commander": "^3.0.0", | ||
"inflected": "^2.0.4", | ||
@@ -44,8 +44,8 @@ "lodash": "^4.17.15", | ||
"devDependencies": { | ||
"@types/chai": "^4.1.7", | ||
"@types/chai": "^4.2.0", | ||
"@types/inflected": "^1.1.29", | ||
"@types/lodash": "^4.14.136", | ||
"@types/lodash": "^4.14.137", | ||
"@types/mocha": "^5.2.7", | ||
"@types/mongodb": "^3.1.28", | ||
"@types/node": "^8.10.44", | ||
"@types/mongodb": "^3.2.3", | ||
"@types/node": "^10.14.15", | ||
"@types/sinon": "^7.0.13", | ||
@@ -59,10 +59,10 @@ "benchmark": "^2.1.4", | ||
"mocha": "^6.2.0", | ||
"mongodb": "^3.2.7", | ||
"mongodb": "^3.3.0", | ||
"mysql": "^2.17.1", | ||
"pg": "^7.11.0", | ||
"pg": "^7.12.1", | ||
"pg-query-stream": "^2.0.0", | ||
"redis": "^2.7.1", | ||
"rimraf": "^2.6.3", | ||
"sinon": "^7.3.2", | ||
"sqlite3": "^4.0.9", | ||
"rimraf": "^3.0.0", | ||
"sinon": "^7.4.1", | ||
"sqlite3": "^4.1.0", | ||
"ts-node": "^8.3.0", | ||
@@ -72,3 +72,3 @@ "tslint": "^5.18.0", | ||
}, | ||
"gitHead": "f35172298f4ba208a7d4c03f2aa43c9ceb3bda45" | ||
"gitHead": "33195a08f4524ca49494a956f84b4bae14e53c03" | ||
} |
314232
8584
+ Addedcommander@3.0.2(transitive)
- Removedcommander@2.20.3(transitive)
Updatedcommander@^3.0.0