Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

binding issue with int #10

hampsterx opened this Issue Sep 12, 2012 · 2 comments


None yet
2 participants

fetchRow("SELECT * FROM user WHERE username = ?", ['3300'], function(err, result) {

This code is not working for me, I suspect the bind value is being converted to an integer even though the field is character varying.

Database Driver: PG

PS Is there a way I can debug to see the generated SQL?




DrBenton commented Sep 16, 2012

Hi !

For tests purposes you can see DBSelect genererated SQL by addind a simple console.log('generated SQL:', sql) in "lib/dbSelect.js", at the end of the "DBSelect.prototype.assemble()" method, line 387.

About your binding issue : this is because the Pg adpater escape policy is based on isNaN(), and a test with isNaN('3300') says that '3300' is a Number.
I'll try to fix it soon.

Thanks for the bug report !


DrBenton commented Jan 13, 2014

Fixed in b044b14.
@hampsterx Thank you very much for the bug report!

@DrBenton DrBenton closed this Jan 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment