Fix pg test and use default parameters in Result object

This commit is contained in:
Timothy Warren 2016-11-21 16:39:56 -05:00
parent 31b0aedc9e
commit ad91099706
2 changed files with 4 additions and 4 deletions

View File

@ -16,9 +16,9 @@ class Result {
* @param {Array} [rows] - the data rows of the result
* @param {Array} [columns] - the column names in the result
*/
constructor (rows, columns) {
this._rows = (rows == null) ? [] : rows;
this._columns = (columns == null) ? [] : columns;
constructor (rows=[], columns=[]) {
this._rows = rows;
this._columns = columns;
// If columns aren't explicitly given,
// get the list from the first row's keys

View File

@ -1,6 +1,6 @@
'use strict';
const Pg = require('./pg');
const Pg = require('./Pg');
module.exports = config => {
return new Pg(config.connection);