True/False support in queries, get APIs
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- JavaScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 8m
- Merged PRs (30d)
- 2
Description
Currently, we cant give queries like this:
// syncPending is a binary JSON field.
db.query(EXTENSIONS_DETAILS_TABLE, "$.syncPending=true");
However, SQL supports the following query string
SELECT * FROM table where document->"$.syncPending" = true;
- We should support binary field values in queries. This is fairly straightforward for non-indexed fields and needs minor adjustments in the query parser to recognize true/false.
-
For indexed fields, there appear to be some issues as SQL doesn't have native binary column types. But may be type compatible https://www.mysqltutorial.org/mysql-boolean/ . investigate if boolean indexed columns can be searched withwe should not index on binary fields.true/falseor should we translate it to1/0
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
The issue centers on db.query, get APIs, and the query parser; begin by locating those entry points and the existing handling of JSON field values. Add coverage for true and false on non-indexed binary JSON fields, and verify the stated decision that binary fields are not indexed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mysql, sql
- Domain
- database
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100