Skip to content

EQL v3 JSON: implement JSONPath selector-with-constraint querying (->, ->>) #623

Description

@coderdan

Context

#621 adds EQL v3 encrypted JSON (types.Json) with containment querying only — ops.contains(col, subObject) emitting the @> operator with a query_jsonb needle.

EQL v3 supports a second JSON query form that #621 does not implement: JSONPath selector with a constraint, e.g.

foo->'bar'  = $1
foo->'wee'  > $1

The eql_v3_json domain ships the operators for it — ->(text|int) and ->>(text|int) — and encryptQuery(value, { queryType: 'searchableJson' }) already auto-infers a selector term for string (JSONPath) needles. What's missing is the adapter surface: the v3 Drizzle operators expose no ->/->> selector, so a selector-with-constraint query can't be expressed, and there are no tests for it.

Proposed change

  • Add selector operators (-> / ->>) to the v3 Drizzle integration for types.Json columns.
  • Compose the extracted selector value with the existing comparison operators so col->'bar' = $1 / col->'wee' > $1 work end-to-end.
  • Add a live oracle + tests (mirroring json-contains.integration.test.ts).
  • Document the pattern in skills/stash-encryption / skills/stash-drizzle.

Notes

https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions