moleculer-db-adapter-sequelize
Advanced tools
Comparing version 0.2.16 to 0.2.17
{ | ||
"name": "moleculer-db-adapter-sequelize", | ||
"version": "0.2.16", | ||
"version": "0.2.17", | ||
"description": "SQL adapter (Postgres, MySQL, SQLite & MSSQL) for Moleculer DB service", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
"peerDependencies": { | ||
"moleculer": "^0.12.0 || ^0.13.0 || ^0.14.0", | ||
"moleculer": "^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0", | ||
"sequelize": "^5.9.4 || ^6.7.0" | ||
@@ -66,3 +66,3 @@ }, | ||
}, | ||
"gitHead": "27e410ca416cd1f97682b7e789c0b8a829717e24" | ||
"gitHead": "b8026d6b112201ed48a2160f8a8623cf816e2083" | ||
} |
@@ -305,6 +305,5 @@ /* | ||
createCursor(params, isCounting) { | ||
const strictCountRule = { distinct: true, col: `${this.model.name ||this.model.tableName}.${this.model.primaryKeyAttribute}` }; | ||
if (!params) { | ||
if (isCounting) | ||
return this.model.count(strictCountRule); | ||
return this.model.count(); | ||
@@ -361,3 +360,3 @@ return this.model.findAll(); | ||
if (isCounting) | ||
return this.model.count(_.merge(q, strictCountRule)); | ||
return this.model.count(q); | ||
@@ -364,0 +363,0 @@ return this.model.findAll(q); |
@@ -8,4 +8,2 @@ "use strict"; | ||
const model = { | ||
tableName: "posts", | ||
primaryKeyAttribute: 'id', | ||
sync: jest.fn(() => Promise.resolve()), | ||
@@ -46,3 +44,2 @@ findAll: jest.fn(() => Promise.resolve()), | ||
define: { | ||
id: { type: "number", primaryKey: true }, | ||
a: 5 | ||
@@ -171,6 +168,3 @@ }, | ||
expect(adapter.model.count).toHaveBeenCalledTimes(1); | ||
expect(adapter.model.count).toHaveBeenCalledWith({ | ||
distinct: true, | ||
col: `${model.tableName}.${model.primaryKeyAttribute}` | ||
}); | ||
expect(adapter.model.count).toHaveBeenCalledWith(); | ||
}); | ||
@@ -191,7 +185,3 @@ | ||
expect(adapter.model.count).toHaveBeenCalledTimes(1); | ||
expect(adapter.model.count).toHaveBeenCalledWith({ | ||
distinct: true, | ||
col: `${model.tableName}.${model.primaryKeyAttribute}`, | ||
where: query | ||
}); | ||
expect(adapter.model.count).toHaveBeenCalledWith({ where: query }); | ||
}); | ||
@@ -198,0 +188,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49730
1469