Created
May 29, 2017 01:19
-
-
Save Grizvok/3b048715134f63dddc714216a796cc37 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doesUserExist() { | |
var rowCount; | |
pg.connect(conString, function (err, client, done) { | |
client.query('SELECT user_id FROM clients.users where user_id=$1', [req.body.user], function(err, result) { | |
if (err) { | |
console.log('error fetching client from pool', err); | |
} | |
else if (result.rowCount === 1) { | |
return rowCount = 1; | |
} | |
}) | |
}); | |
return rowCount; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment