aicore / aicore/libmysql

True/False support in queries, get APIs

Open
#153 0 comments 0 reactions 0 assignees View on GitHub

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 with true/false or should we translate it to 1/0 we should not index on binary fields.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.