Comparing version 6.9.1 to 6.10.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [6.10.0](https://gitlab.com/dmfay/massive-js/compare/v6.9.1...v6.10.0) (2021-07-17) | ||
### Features | ||
* Do not allow a statement to have null or undefined criteria. ([936988a](https://gitlab.com/dmfay/massive-js/commit/936988a7c76756588b4a88ba8193007ae2a7388a)) | ||
### [6.9.1](https://gitlab.com/dmfay/massive-js/compare/v6.9.0...v6.9.1) (2021-06-21) | ||
@@ -7,0 +14,0 @@ |
@@ -15,3 +15,3 @@ 'use strict'; | ||
*/ | ||
const Delete = function (source, criteria = {}, options = {}) { | ||
const Delete = function (source, criteria, options = {}) { | ||
Statement.call(this, source, options, true); | ||
@@ -18,0 +18,0 @@ |
@@ -16,3 +16,3 @@ 'use strict'; | ||
*/ | ||
const Select = function (source, criteria = {}, options = {}) { | ||
const Select = function (source, criteria, options = {}) { | ||
Statement.call(this, source, options); | ||
@@ -19,0 +19,0 @@ |
@@ -54,2 +54,6 @@ 'use strict'; | ||
Statement.prototype.setCriteria = function (criteria, prepend = []) { | ||
if (!criteria) { | ||
throw new Error('Criteria cannot be null or undefined. Pass {} to operate on all rows.'); | ||
} | ||
if (!_.isPlainObject(criteria)) { | ||
@@ -56,0 +60,0 @@ // primitive unary pk search |
@@ -16,3 +16,3 @@ 'use strict'; | ||
*/ | ||
const Update = function (source, changes, criteria = {}, options = {}) { | ||
const Update = function (source, changes, criteria, options = {}) { | ||
Statement.call(this, source, options, true); | ||
@@ -19,0 +19,0 @@ |
{ | ||
"name": "massive", | ||
"version": "6.9.1", | ||
"version": "6.10.0", | ||
"description": "A small query tool for Postgres that embraces json and makes life simpler", | ||
@@ -5,0 +5,0 @@ "homepage": "https://massivejs.org", |
189118
3105