Skip to content

Support IS NOT NULL in query syntax #46

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

Merged
merged 2 commits into from
Dec 7, 2015
Merged

Conversation

eldridge
Copy link
Contributor

@eldridge eldridge commented Dec 6, 2015

Without this, I see queries like WHERE field != NULL, which doesn't work in MySQL (and possibly other SQL dialects).

@techniq
Copy link
Member

techniq commented Dec 7, 2015

@mechanicalpulse It looks like your test includes the WHERE field is NULL case as well, but was surprised it didn't require using knex's whereNull like whereNotNull does. Probably because it doesn't have an explicit operator in this case and knex is being smart for us.

One last thing and I'll merge it in and tag a release for you... could you also cover the |!== operator (OR field is NOT NULL) as well with this PR

@eldridge
Copy link
Contributor Author

eldridge commented Dec 7, 2015

I added the test case just in case something changes in knex. Do you think it would be more appropriate to specifically handle the whereNull case instead of relying on knex's behavior?

@techniq
Copy link
Member

techniq commented Dec 7, 2015

@mechanicalpulse I don't see it being a bad thing to handle it explicitly, just in case knex's behavior changes

techniq added a commit that referenced this pull request Dec 7, 2015
Support IS NOT NULL in query syntax
@techniq techniq merged commit 4830b84 into js-data:master Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants