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.1.4 to 6.2.0

18

CHANGELOG.md

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

## [6.2.0](https://gitlab.com/dmfay/massive-js/compare/v6.1.4...v6.2.0) (2020-02-09)
### Features
* support all explicit locking options for SELECT ([c19b17c](https://gitlab.com/dmfay/massive-js/commit/c19b17ce5c01fc58acabdc01196a5796c5420332))
### Bug Fixes
* **deps:** update dependency commander to v4.1.0 ([c7c3520](https://gitlab.com/dmfay/massive-js/commit/c7c352096751af110a0c0170a6ddb7ec354d5ee3))
* **deps:** update dependency commander to v4.1.1 ([64d22d2](https://gitlab.com/dmfay/massive-js/commit/64d22d2393832266845c620383ff623b5ae73df0))
* **deps:** update dependency pg-promise to v10.3.2 ([b5d2d9e](https://gitlab.com/dmfay/massive-js/commit/b5d2d9ed2a563b9dd2fe54ca3eb671877b2d85cf))
* **deps:** update dependency pg-promise to v10.4.3 ([81b3d39](https://gitlab.com/dmfay/massive-js/commit/81b3d39f17d3d3ffa9ed8799994588fff3d7acd4))
* **deps:** update dependency pg-query-stream to v3 ([2064bdb](https://gitlab.com/dmfay/massive-js/commit/2064bdbf6150d75fc3b7788191e4f5ce176ff1af))
* decomposing a resultset missing a schema-defined field will not include explicit undefineds ([ee34d87](https://gitlab.com/dmfay/massive-js/commit/ee34d876f472ba1cd353909240261fa6ceede6e0))
* **deps:** update dependency pg-query-stream to v2.1.2 ([5a970a8](https://gitlab.com/dmfay/massive-js/commit/5a970a8b715667732e63c4964674988bbd292c86))
### [6.1.4](https://gitlab.com/dmfay/massive-js/compare/v6.1.3...v6.1.4) (2019-12-11)

@@ -7,0 +25,0 @@

38

lib/statement/select.js

@@ -35,4 +35,3 @@ 'use strict';

this.pageLength = options.pageLength;
this.forUpdate = options.forUpdate || false;
this.forShare = options.forShare || false;
this.lock = this.parseLock(options);

@@ -152,2 +151,33 @@ // with pageLength set for keyset pagination, add last values of ordering

/**
* Parse a query explicit locking options, supporting legacy `forUpdate` and `forShare`
* and `forShare` arguments
* @param {Object} [options] - {@link https://massivejs.org/docs/options-objects|Select options}
* @return {Object} a lock object
*/
Select.prototype.parseLock = function (options) {
// TODO remove forUpdate and forShare in v7
const {forUpdate, forShare, lock} = options;
// fail if more than one of those options is not null and not undefined
if ([forShare, forUpdate, lock].filter((x) => x != null).length > 1) {
throw new Error('The "forUpdate", "forShare", and "lock" options are mutually exclusive');
}
if (forUpdate !== undefined || forShare !== undefined && process.env.NODE_ENV !== 'production') {
/* eslint-disable-next-line no-console */
console.log('DEPRECATED: the "forShare" and "forUpdate" options are deprecated and will be removed in a future version. Use "lock" instead.');
}
if (forUpdate) {
return {strength: 'UPDATE'};
}
if (forShare) {
return {strength: 'SHARE'};
}
return options.lock;
};
/**
* Format this object into a SQL SELECT.

@@ -176,4 +206,4 @@ *

if (this.order.length) { sql += ` ORDER BY ${this.order.join(',')}`; }
if (this.forUpdate) { sql += ' FOR UPDATE'; }
if (this.forShare) { sql += ' FOR SHARE'; }
if (this.lock) { sql += ` FOR ${this.lock.strength}`; }
if (this.lock && this.lock.lockedRows) { sql += ` ${this.lock.lockedRows}`; }
if (this.pageLength) { sql += ` FETCH FIRST ${this.pageLength} ROWS ONLY`; }

@@ -180,0 +210,0 @@ if (this.offset) { sql += ` OFFSET ${this.offset}`; }

@@ -73,6 +73,14 @@ 'use strict';

// columns is just a list of field names
mapper = val => obj[strid][val] = row[val];
mapper = val => {
if (row[val] !== undefined) {
obj[strid][val] = row[val];
}
};
} else {
// the columns object maps field names in the row to object key names
mapper = (val, key) => obj[strid][val] = row[key];
mapper = (val, key) => {
if (row[key] !== undefined) {
obj[strid][val] = row[key];
}
};
}

@@ -79,0 +87,0 @@

16

package.json
{
"name": "massive",
"version": "6.1.4",
"version": "6.2.0",
"description": "A small query tool for Postgres that embraces json and makes life simpler",

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

"dependencies": {
"commander": "4.0.1",
"commander": "4.1.1",
"glob": "7.1.6",
"lodash": "4.17.15",
"murmurhash": "0.0.2",
"pg-promise": "10.3.1",
"pg-query-stream": "2.0.1"
"pg-promise": "10.4.3",
"pg-query-stream": "3.0.2"
},

@@ -64,6 +64,6 @@ "devDependencies": {

"coveralls": "3.0.9",
"eslint": "6.7.2",
"mocha": "6.2.2",
"nyc": "14.1.1",
"standard-version": "7.0.1"
"eslint": "6.8.0",
"mocha": "7.0.1",
"nyc": "15.0.0",
"standard-version": "7.1.0"
},

@@ -70,0 +70,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