Skip to content
New issue

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

IEqual gives incorrect sql on special characters #17

Closed
lroal opened this issue Jan 6, 2016 · 1 comment
Closed

IEqual gives incorrect sql on special characters #17

lroal opened this issue Jan 6, 2016 · 1 comment
Labels

Comments

@lroal
Copy link
Member

lroal commented Jan 6, 2016

I run with getMany with filter on email column. This crashes when email has underscore. The generated sql looks like this:

select _user.id as s_user0,
_user.email as s_user1,
_user.password as s_user2,
_user.salt as s_user3,
_user.plan as s_user4,
_user.registered_date as s_user5,
_user.trial_until as s_user6,
_user.premium_until as s_user7,
_user.stripe_id as s_user8
from _user _user
where _user.email ILIKE '$1' order by _user.id

The code:
var emailFilter = userTable.email.iEqual('foo@gmail.com');
return userTable.getMany(emailFilter).then(createAccount);

@lroal lroal added the bug label Jan 6, 2016
@lroal
Copy link
Member Author

lroal commented Jan 6, 2016

The bug is that the parameter should not be in qoutes.
The expected sql is:
select ... where _user.email ILIKE $1 order by _user.id

@lroal lroal closed this as completed in a7f1f2d Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant