loopbackio / loopbackio/loopback-connector-postgresql
neq in where filter does not include null values
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 118
- Forks
- 184
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 5
Description
Description/Steps to reproduce
- Create a model with String properties
- Insert instances with one of the string properties unset. (NULL in DB)
- Run a query for model {where: {stringProp: {neq: "value"}}}
- NULL entries are not included
Expected result
Null entries are not equal to value so should be included
Additional information
I notice that the output sql from the connector is !=, whereas IS DISTINCT FROM would work for NULL values. As far as I can tell, there is no operator that will invoke IS DISTINCT FROM. If this won't be fixed/is considered not an issue, having this at least documented somewhere would be useful.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the described where query in the PostgreSQL connector and inspect how the neq filter becomes SQL. Compare the generated != condition with PostgreSQL's NULL behavior; done means NULL entries are included as expected, or the limitation is documented if that behavior is not supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, postgresql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100