machinepack-postgresql
Advanced tools
Comparing version
@@ -46,3 +46,3 @@ module.exports = { | ||
description: 'If specified, the rows coming back from the query will be sorted according to this dictionary.', | ||
typeclass: 'dictionary' | ||
example: [{ columnName: 'foo', direction: 1 }] | ||
}, | ||
@@ -53,3 +53,3 @@ | ||
extendedDescription: 'This is used to determine the `columns` (i.e. projection) passed in w/ the query.', | ||
typeclass: 'array', | ||
example: [{ fieldName: 'username', type: 'string' }], | ||
required: true | ||
@@ -104,3 +104,3 @@ } | ||
case 'array': | ||
example[column.fieldName] = '[1,2,3]'; | ||
example[column.fieldName] = '[1]'; | ||
break; | ||
@@ -132,4 +132,10 @@ }; | ||
if(inputs.skip) query.skip = inputs.skip; | ||
if(inputs.sort) query.sort = inputs.sort; | ||
if(inputs.sort) { | ||
query.sort = {}; | ||
// Parse array and turn into a WL sort criteria | ||
inputs.sort.forEach(function(sorter) { | ||
query.sort[sorter.columnName] = sorter.direction; | ||
}); | ||
} | ||
@@ -136,0 +142,0 @@ // WL SQL options |
{ | ||
"name": "machinepack-postgresql", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Structured Node.js bindings for Postgresql.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
22611
1.01%562
1.08%