Skip to content

Add support for JSON_LIST equals query operation - #268

Merged
pavelhoral merged 1 commit into
WrenSecurity:mainfrom
karelmaxa:feat-repo-json-list-eq
May 27, 2026
Merged

Add support for JSON_LIST equals query operation#268
pavelhoral merged 1 commit into
WrenSecurity:mainfrom
karelmaxa:feat-repo-json-list-eq

Conversation

@karelmaxa

Copy link
Copy Markdown
Member

This PR adds eq query filter support for columns mapped with the JSON_LIST value type, allowing callers to check whether a string value is an element of the JSON array stored in a given column. The implementation introduces a protected visitJsonListAssertion hook in MappedSQLQueryFilterVisitor that is overridden in each vendor handler using the appropriate database-native JSON function — PostgreSQL uses the JSONB containment operator, MySQL uses JSON_CONTAINS, Oracle uses JSON_EXISTS, and MSSQL uses OPENJSON. Any operator other than equals on a JSON_LIST column will throw UnsupportedOperationException.

@karelmaxa
karelmaxa requested a review from pavelhoral April 30, 2026 13:58
}

if (valueAssertion instanceof String && config.valueType == ValueType.JSON_LIST) {
if (!"=".equals(operand)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this make sense? Filtering on array values is well defined. I don't see why other operands should not be supported.

@karelmaxa
karelmaxa force-pushed the feat-repo-json-list-eq branch from bc88afd to 54e1051 Compare May 20, 2026 12:08
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
13.3% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@pavelhoral pavelhoral left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I would make the implementation more complete in #271, but that still needs quite a lot of work. Merging this instead as it is pretty compact change with minimal impact.

@pavelhoral
pavelhoral merged commit 0b0fdd7 into WrenSecurity:main May 27, 2026
4 checks passed
@karelmaxa
karelmaxa deleted the feat-repo-json-list-eq branch May 29, 2026 14:21
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