New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

massive

Package Overview
Dependencies
Maintainers
2
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

massive - npm Package Compare versions

Comparing version 6.8.0 to 6.9.0

8

CHANGELOG.md

@@ -5,2 +5,10 @@ # Changelog

## [6.9.0](https://gitlab.com/dmfay/massive-js/compare/v6.8.0...v6.9.0) (2021-05-13)
### Features
* $set fields to raw SQL expressions in update ([64fab99](https://gitlab.com/dmfay/massive-js/commit/64fab99a9fd1eca1ab8e88700306d4bb3777a24e))
* support $and and $or criteria keys ([211f11e](https://gitlab.com/dmfay/massive-js/commit/211f11e75f5903b74da2fbc7f362c3d6cc9ef4fd))
## [6.8.0](https://gitlab.com/dmfay/massive-js/compare/v6.7.1...v6.8.0) (2021-04-24)

@@ -7,0 +15,0 @@

16

lib/readable.js

@@ -265,3 +265,3 @@ 'use strict';

* @param {Object} criteria - The criteria object representing the JOIN
* conditions. May be nested with `or`, just as ordinary criteria objects.
* conditions. May be nested with `$or`, just as ordinary criteria objects.
* @param {Number} offset - Offset prepared statement parameter ordinals

@@ -294,3 +294,3 @@ * @param {Symbol} kind - forJoin, forWhere, or forDoc.

* @param {Object} criteria - The criteria object representing the JOIN
* conditions. May be nested with `or`, just as ordinary criteria objects.
* conditions. May be nested with `$or`, just as ordinary criteria objects.
* @param {Number} offset - Offset prepared statement parameter ordinals

@@ -303,3 +303,5 @@ * @param {Symbol} kind - forJoin, forWhere, or forDoc.

return _.reduce(criteria, (conjunction, val, key) => {
if (key === 'or') {
// TODO un-$ed names are officially deprecated but may or may not ever be
// practical to remove
if (['$or', 'or'].indexOf(key) > -1) {
const disjunction = this.disjoin(val, conjunction.offset + conjunction.params.length, kind, ...args);

@@ -311,3 +313,3 @@

return conjunction;
} else if (key === 'and') {
} else if (['$and', 'and'].indexOf(key) > -1) {
const predicates = []; // track subconjunction predicates separately since they're grouped together

@@ -396,5 +398,5 @@

* including operation eg 'my_field <>') to the parameter values. Predicates
* generated from a criteria object are joined together with `and`; an `or` key
* denotes an array of nested criteria objects, the collected predicates from
* each of which are parenthesized and joined with `or`.
* generated from a criteria object are joined together with `$and`; an `$or`
* key denotes an array of nested criteria objects, the collected predicates
* from each of which are parenthesized and joined with `$or`.
* @param {Number} offset - Added to the token index value in the prepared

@@ -401,0 +403,0 @@ * statement (with offset 0, parameters will start $1, $2, $3).

@@ -21,7 +21,17 @@ 'use strict';

changes = _.pick(changes, source.columnNames);
changes = _.pick(changes, [...source.columnNames, '$set']);
this.changes = _.reduce(changes, (acc, value, key) => {
acc.push(`"${key}" = $${++offset}`);
if (key === '$set' && _.isObject(value)) {
Object.entries(value).forEach(([setKey, setValue]) => {
if (Object.keys(changes).includes(setKey)) {
throw new Error(`The key '${setKey}' may not be defined in both the change map and the $set map.`);
}
acc.push(`"${setKey}" = ${setValue}`);
});
} else {
acc.push(`"${key}" = $${++offset}`);
}
return acc;

@@ -28,0 +38,0 @@ }, []);

{
"name": "massive",
"version": "6.8.0",
"version": "6.9.0",
"description": "A small query tool for Postgres that embraces json and makes life simpler",

@@ -52,17 +52,17 @@ "homepage": "https://massivejs.org",

"dependencies": {
"commander": "7.1.0",
"glob": "7.1.6",
"commander": "7.2.0",
"glob": "7.1.7",
"lodash": "4.17.21",
"murmurhash": "1.0.0",
"pg-promise": "^10.9.4",
"pg-query-stream": "^4.0.0"
"pg-promise": "^10.10.2",
"pg-query-stream": "^4.1.0"
},
"devDependencies": {
"chai": "4.3.0",
"chai": "4.3.4",
"chai-as-promised": "7.1.1",
"coveralls": "3.1.0",
"eslint": "7.20.0",
"mocha": "8.3.0",
"eslint": "7.26.0",
"mocha": "8.4.0",
"nyc": "15.1.0",
"standard-version": "9.1.1"
"standard-version": "9.3.0"
},

@@ -69,0 +69,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc