This commit is contained in:
Josh Harvey 2014-05-02 10:25:39 -04:00
parent 2d0938c1e5
commit d2cb7e8a07
7 changed files with 44 additions and 36 deletions

View file

@ -1,6 +1,8 @@
'use strict';
var pg = require('pg');
var logger = require('./logger');
var PG_ERRORS = {
23505: 'uniqueViolation'
};
@ -11,9 +13,7 @@ var PostgresqlInterface = function (conString) {
}
this.client = new pg.Client(conString);
// TODO better logging
this.client.on('error', function (err) { console.log(err); });
this.client.on('error', function (err) { logger.error(err); });
this.client.connect();
};