feature: implement in for sqlite databases #276
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checks
What did this pull request do?
This PR ensures that the implementation for
JSONArrayQuery
in the SQLite dialect is now complete. That is,the
JSONArrayQuery.In
method now works for SQLite.This should resolve issue #151 partially.
Use case description
Previously, we implemented
JSONArrayQuery.In
for MySQL. Now we can do the same for SQLite.If we wish to check if the element at key$\{1, 2\}$ , we can do
"a"
is in the setThis gets translated to
This query returns row 2.
The reason for differentiating arrays and other JSON objects is because MySQL's
JSON_CONTAINS
functionis able to check if an array's elements are all within another array. If we wish to achieve feature parity for the
different dialects, the SQLite implementation should also support such queries.
For arrays, we check if there is an element that does not exist in the target array. For other json objects, we use
IN
directly.