Skip to content

json_tree operators (@>, <@, equality and ordering at a path, ->) have no data-plan form #1350

Closed

Description

@coderdan

Background

A Go program queries an encrypted column by asking the engine for a query term for one operator, such as eq or lt. The engine returns the EQL query value, which the program sends as a SQL parameter (ADR-0009, query by operator). The engine also reports which operators each field supports (se_operators), and stashgen generates one Go method per operator.

Problem

The json_tree operators have no data-plan form. The engine answers them only from typed Rust (op::Contains, op::AtPath(op::Lt), …):

  • @> containment;
  • <@ contained-by;
  • scalar equality at a path;
  • < <= > >= and range at an ordered path;
  • the path selector used by ->.

The Go checker also accepts only eq lt lte gt gte between matches.

Proposal

  1. Add the data-plan operators:
    • contains and contained_by, whose input is a JSON document;
    • eq_at, lt/lte/gt/gte/between at a path, and selector, whose input is {path, value}.
  2. Have se_operators report them per field, from the field's options. The ordering operators appear only for ordered paths.
  3. Have se_query_term return the query value's JSON and its PostgreSQL domain (eql_v4.query_json_tree, eql_v4.query_json_tree_leaf), as it does for other EQL types.
  4. Keep the engine's refusals and their reasons: a container at a path, an ordering value that is not a number or string, a path that is not ordered, a position in an ordered path.
  5. Tests: data-plan versus typed parity for every operator.

Depends on the data-plan issue.

Plan: docs/plans/2026-10-24-go-json-tree.md, step 3.

Metadata

Metadata

Assignees

Labels

RustSDKenhancementneeds-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions