|
|
@ -292,6 +292,12 @@ exports.postgresQuery = function (connectionString, query) {
|
|
|
|
client.end();
|
|
|
|
client.end();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// Connected here
|
|
|
|
// Connected here
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
// No query provided by user, use SELECT 1
|
|
|
|
|
|
|
|
if (!query || (typeof query === "string" && query.trim() === "")) {
|
|
|
|
|
|
|
|
query = "SELECT 1";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
client.query(query, (err, res) => {
|
|
|
|
client.query(query, (err, res) => {
|
|
|
|
if (err) {
|
|
|
|
if (err) {
|
|
|
|
reject(err);
|
|
|
|
reject(err);
|
|
|
@ -300,6 +306,9 @@ exports.postgresQuery = function (connectionString, query) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
client.end();
|
|
|
|
client.end();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
reject(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|