Comparing version 6.0.0 to 6.1.0
@@ -5,2 +5,16 @@ # Changelog | ||
## [6.1.0](https://gitlab.com/dmfay/massive-js/compare/v6.0.0...v6.1.0) (2019-09-14) | ||
### Bug Fixes | ||
* **deps:** update dependency commander to v3.0.1 ([a0698df](https://gitlab.com/dmfay/massive-js/commit/a0698df)) | ||
* **deps:** update dependency pg-promise to v9.1.2 ([822b5a4](https://gitlab.com/dmfay/massive-js/commit/822b5a4)) | ||
* **deps:** update dependency pg-promise to v9.1.4 ([e44e54f](https://gitlab.com/dmfay/massive-js/commit/e44e54f)) | ||
### Features | ||
* select distinct ([bd9fcf7](https://gitlab.com/dmfay/massive-js/commit/bd9fcf7)) | ||
## [6.0.0](https://gitlab.com/dmfay/massive-js/compare/v5.11.2...v6.0.0) (2019-09-01) | ||
@@ -7,0 +21,0 @@ |
@@ -41,4 +41,5 @@ 'use strict'; | ||
// options governing SQL statement elements, in rough order of appearance: | ||
this.distinct = options.distinct || false; | ||
this.selectList = this.buildSelectList(options.fields, options.exprs); | ||
this.only = options.only || false; | ||
this.selectList = this.buildSelectList(options.fields, options.exprs); | ||
this.conditions = conditions; | ||
@@ -175,4 +176,8 @@ this.order = _.reduce(options.order, (acc, val) => { | ||
Select.prototype.format = function () { | ||
let sql = `SELECT ${this.selectList.join(',')} FROM `; | ||
let sql = 'SELECT '; | ||
if (this.distinct) { sql += 'DISTINCT '; } | ||
sql += `${this.selectList.join(',')} FROM `; | ||
if (this.only) { sql += 'ONLY '; } | ||
@@ -179,0 +184,0 @@ |
{ | ||
"name": "massive", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "A small query tool for Postgres that embraces json and makes life simpler", | ||
@@ -52,7 +52,7 @@ "homepage": "https://massivejs.org", | ||
"dependencies": { | ||
"commander": "3.0.0", | ||
"commander": "3.0.1", | ||
"glob": "7.1.4", | ||
"lodash": "4.17.15", | ||
"murmurhash": "0.0.2", | ||
"pg-promise": "9.1.0", | ||
"pg-promise": "9.1.4", | ||
"pg-query-stream": "2.0.0" | ||
@@ -64,3 +64,3 @@ }, | ||
"coveralls": "3.0.6", | ||
"eslint": "6.2.2", | ||
"eslint": "6.4.0", | ||
"mocha": "6.2.0", | ||
@@ -67,0 +67,0 @@ "nyc": "14.1.1", |
176616
3039
+ Addedassert-options@0.6.0(transitive)
+ Addedcommander@3.0.1(transitive)
+ Addedpg-minify@1.5.0(transitive)
+ Addedpg-promise@9.1.4(transitive)
+ Addedspex@3.0.0(transitive)
- Removedassert-options@0.4.0(transitive)
- Removedcommander@3.0.0(transitive)
- Removedpg-minify@1.4.1(transitive)
- Removedpg-promise@9.1.0(transitive)
- Removedspex@2.2.0(transitive)
Updatedcommander@3.0.1
Updatedpg-promise@9.1.4