neopg 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/ModelChain.js +3 -1
- package/package.json +1 -1
- package/test/test-db.js +1 -1
package/lib/ModelChain.js
CHANGED
|
@@ -247,7 +247,9 @@ class ModelChain {
|
|
|
247
247
|
|
|
248
248
|
_buildOrder() {
|
|
249
249
|
if (this._order.length === 0) return this.sql``
|
|
250
|
-
return this.sql`ORDER BY ${this._order}`
|
|
250
|
+
if (this._order.length === 1) return this.sql`ORDER BY ${this._order}`
|
|
251
|
+
let _orderby = this._order.reduce((acc, curr) => this.sql`${acc}, ${curr}`)
|
|
252
|
+
return this.sql`ORDER BY ${_orderby}`
|
|
251
253
|
}
|
|
252
254
|
|
|
253
255
|
_buildJoins() {
|
package/package.json
CHANGED