We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's my code:
contacts.publish('contact', function(){ return contacts.select('id', 'firstname', 'lastname') .where('id != ?', 1) .order('firstname DESC') .limit(100); });
The query sent to postgres from my app is:
SELECT id, firstname, lastname FROM contact WHERE id != $1 ORDER BY firstname DESC LIMIT 100;
But postgres says:
ERROR: there is no parameter $1 at character 58
If I recode as follows:
contacts.publish('contact', function(){ return contacts.select('id', 'firstname', 'lastname') .where("id != '1'") .order('firstname DESC') .limit(100); }); I get:
contacts.publish('contact', function(){ return contacts.select('id', 'firstname', 'lastname') .where("id != '1'") .order('firstname DESC') .limit(100); });
ERROR: syntax error at or near "$1" at character 54 SELECT id, firstname, lastname FROM contact WHERE $0$1id != '1' ORDER BY firstname DESC LIMIT 100;
What's up with the positionals, they are inserted deliberately but postgres doesn't like them. I must be missing something
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here's my code:
contacts.publish('contact', function(){ return contacts.select('id', 'firstname', 'lastname') .where('id != ?', 1) .order('firstname DESC') .limit(100); });
The query sent to postgres from my app is:
SELECT id, firstname, lastname FROM contact WHERE id != $1 ORDER BY firstname DESC LIMIT 100;
But postgres says:
ERROR: there is no parameter $1 at character 58
If I recode as follows:
contacts.publish('contact', function(){ return contacts.select('id', 'firstname', 'lastname') .where("id != '1'") .order('firstname DESC') .limit(100); });
I get:
ERROR: syntax error at or near "$1" at character 54 SELECT id, firstname, lastname FROM contact WHERE $0$1id != '1' ORDER BY firstname DESC LIMIT 100;
What's up with the positionals, they are inserted deliberately but postgres doesn't like them. I must be missing something
The text was updated successfully, but these errors were encountered: