Go SDK: generate one query method per operator, with Verify and TargetLimit on probabilistic terms #1189
Copy link
Copy link
Closed
Labels
SDKStagedDone in the next branch; closes when next merges into mainDone in the next branch; closes when next merges into mainenhancementNew feature or requestNew feature or request
Milestone
Description
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
-
stashgengenerates one method per operator the field's EQL type answers, with the operator's input in the signature, such asFields.Name.Matches(ctx, cipher, "ali")andFields.Age.Between(ctx, cipher, lo, hi). A field whose type does not answer an operator has no such method. -
stashgentakes the operators and their fidelity from the engine catalog, and holds no copy of those rules. - The query types of probabilistic operators carry
VerifyandTargetLimit, and exact ones carry neither. Each keepsdriver.Valuer. -
Verifyover a page of rows is one call into the guest. - Each Go width rule holds in the generated signatures.
- The README and
doc.goshow the query withdatabase/sqland the decrypt-and-verify step. - Hermetic tests against the guest, and a PostgreSQL test that runs a
Matchesquery and verifies its rows.
Related
- Depends on Amend ADR-0007 for operator queries, and add the guest's query, verify and target_limit exports #1188.
- stashgen refuses TextMatch, TextSearch, TextOrd and TextOrdOpe — the engine derives their terms, but no EQL type is built from them #1131:
TextMatchin the Go SDK. - Go SDK: no test stores a generated type through database/sql, pgx, sqlc or GORM — add a PostgreSQL job #1114: storing a generated type through
database/sql, pgx, sqlc and GORM. - docs(adr): ADR-0009, operators select the index and a query term is not the stored term #1177: ADR-0009, appendix B.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SDKStagedDone in the next branch; closes when next merges into mainDone in the next branch; closes when next merges into mainenhancementNew feature or requestNew feature or request
Activity
feat(stack-encrypt): let a binding ask which operators a plan field a…
feat(golang)!: generate one query method per operator the engine answ…
test(golang): run a matches query and verify its rows against Postgre…
docs(golang): show the query methods, the database/sql query and the …
feat(stack-encrypt): let a binding ask which operators a plan field a…
feat(golang)!: generate one query method per operator the engine answ…
test(golang): run a matches query and verify its rows against Postgre…
docs(golang): show the query methods, the database/sql query and the …
feat(stack-encrypt): let a binding ask which operators a plan field a…
feat(golang)!: generate one query method per operator the engine answ…
test(golang): run a matches query and verify its rows against Postgre…
docs(golang): show the query methods, the database/sql query and the …
1 remaining item
feat(golang)!: generate one query method per operator the engine answ…
test(golang): run a matches query and verify its rows against Postgre…
docs(golang): show the query methods, the database/sql query and the …
feat(stack-encrypt): let a binding ask which operators a plan field a…
feat(golang)!: generate one query method per operator the engine answ…
test(golang): run a matches query and verify its rows against Postgre…
docs(golang): show the query methods, the database/sql query and the …
feat(stack-encrypt): let a binding ask which operators a plan field a…
feat(golang)!: generate one query method per operator the engine answ…
test(golang): run a matches query and verify its rows against Postgre…
docs(golang): show the query methods, the database/sql query and the …
coderdan commentedon Oct 17, 2026
Staged: done in
nextby #1216. This stays open untilnextmerges intomain, which closes it.