Skip to content

Go SDK: generate one query method per operator, with Verify and TargetLimit on probabilistic terms #1189

Open

Description

@coderdan

Background

The Go SDK's generated code has one query method per field: users.Fields.Email.Query(ctx, cipher, v), which returns the field's query operand, with the term chosen by the field's EQL type. ADR-0009 appendix B sketches the Go SDK under the operator model.

Problem

A Go caller cannot ask for a particular operator, cannot pass operator-specific input such as Between's two bounds, and gets no help verifying the results of a probabilistic query.

Proposal

  • stashgen generates one method per operator the field's EQL type answers, with the operator's input in the signature, such as Fields.Name.Matches(ctx, cipher, "ali") and Fields.Age.Between(ctx, cipher, lo, hi). A field whose type does not answer an operator has no such method.
  • stashgen takes the operators and their fidelity from the engine catalog, and holds no copy of those rules.
  • The query types of probabilistic operators carry Verify and TargetLimit, and exact ones carry neither. Each keeps driver.Valuer.
  • Verify over a page of rows is one call into the guest.
  • Each Go width rule holds in the generated signatures.
  • The README and doc.go show the query with database/sql and the decrypt-and-verify step.
  • Hermetic tests against the guest, and a PostgreSQL test that runs a Matches query and verifies its rows.

Related

Activity

  1. self-assigned this
    on Oct 13, 2026
  2. added 20 commits that reference this issue on Oct 16, 2026
  3. added
    StagedDone in the next branch; closes when next merges into main
    on Oct 17, 2026
  4. coderdan commented on Oct 17, 2026

    @coderdan
    ContributorAuthor

    Staged: done in next by #1216. This stays open until next merges into main, which closes it.

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

Metadata

Metadata

Assignees

Labels

SDKStagedDone in the next branch; closes when next merges into mainenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions