Skip to content

json_tree is missing from the EQL catalog, so no Go types are generated for it #1348

Open

Description

@coderdan

Background

json_tree is the EQL v4 type family for an encrypted JSON document. EQL (Encrypt Query Language) is the SQL library installed into a customer's PostgreSQL database; Stack Encrypt is the Rust engine that encrypts the values EQL stores. The Rust engine and the SQL for json_tree are built in #1288, #1325, #1329 and #1336.

Every EQL type is listed in one catalog. eql-codegen reads that catalog to generate the Rust target table and the Go types in languages/golang/encrypt/eql/eql_gen.go. A Go program stores and queries EQL columns through those generated types.

Problem

The json_tree types were hand-written in packages/eql/crates/eql-bindings/src/v4/json_tree.rs and never added to the catalog. That file says so itself: the family is "not in the catalog yet, so it is not in super::all nor in the target table".

So:

  • the Go SDK has no eql.JSONTree type to scan a column into;
  • the engine's guest cannot look the type up by name;
  • stashgen cannot see that a json_tree field must use null=sql. A null document cannot be padded to a value's length, because documents have no single length.

Proposal

  1. Add the json_tree family to the catalog, v4::all() and the target table: the stored type, the query type, the leaf query type and the entry type.
  2. Run mise run types:generate, so eql_gen.go gains JSONTree, JSONTreeQuery, JSONTreeLeafQuery and JSONTreeEntry. Each is marked not producible, with a reason that points at the data-plan issue.
  3. Decide whether the selector, which is a text value, needs a generated or a hand-written Go type.
  4. Report the family as not fixed-width, so stashgen requires null=sql.
  5. Gates: types:check, go_eql_parity and the eql-codegen tests.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SDKenhancementNew feature or requestneeds-triageMaintainer needs to evaluate the issuerustPull requests that update Rust code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions