2016-12-23 10:16:12 +00:00
|
|
|
var pg = require('pg');
|
|
|
|
|
|
|
|
function onConnect(err, client, done) {
|
|
|
|
if (err) {
|
|
|
|
console.error(err);
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
client.end();
|
|
|
|
}
|
|
|
|
|
|
|
|
exports.connTest = function () {
|
|
|
|
pg.connect(Connections.pg_sjy_eco, function (err, db) {
|
|
|
|
if (err) {
|
|
|
|
console.log(err);
|
|
|
|
process.exit(0);
|
|
|
|
} else {
|
2016-12-24 18:56:44 +00:00
|
|
|
console.log('pg conn ok');
|
2016-12-23 10:16:12 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|