Repository navigation
stash schema build: port the v2 capability column picker to EQL v3 domains #751
Description
Prerequisite for #707 (EQL v2 removal). Port stash schema build's v2 capability-based column picker to EQL v3 fixed domains.
Why this is a v2-removal prerequisite
Like #693 (ALTER COLUMN) and #657 (DynamoDB), this is an unfinished v3 feature, not a removal side-effect — v2's presence currently disguises it as "the picker works." It needs building whether or not v2 is ever deleted. It is called out in docs/plans/2026-07-20-eql-v2-removal-scope.md §3.4 and §9 (recommended order, item 4) but — unlike the other two prerequisites — has no tracking issue.
What the picker is
stash schema build drives the full v2 chainable capability model and reaches production:
packages/cli/src/commands/init/types.ts:9—export type SearchOp = 'equality' | 'orderAndRange' | 'freeTextSearch'packages/cli/src/commands/init/lib/introspect.ts:102—allSearchOps()producesSearchOp[].../introspect.ts:119—selectTableColumns(), with thep.multiselectcolumn picker at:147and the searchable flow at:175.../introspect.ts:197—buildSchemasFromDatabase()packages/cli/src/commands/schema/build.ts:5,58,65—schema buildcallsbuildSchemasFromDatabase()thengenerateClientFromSchemas()
Common misread (already burned us once — scope §3.4)
The init path is already v3-neutral: it sets schemas: [] (init/steps/build-schema.ts:85,147) and only calls generatePlaceholderClient(). Tracing init alone concludes SearchOp/ColumnDef are dead — they are not. stash schema build still drives the full capability picker. Confirm against the schema build path, not init.
The actual work
The capability tuple (equality | orderAndRange | freeTextSearch) has no v3 analogue — v3's query capability is fixed by the concrete domain type (types.TextSearch, types.IntegerOrd, types.Json, …), not by chainable toggles. So the port is a redesign of the picker UX from "toggle a set of capabilities per column" to "choose a domain per column," plus regenerating v3 client output. This is design work, not a mechanical rename.
Open design questions:
- How to map an introspected Postgres column type to the candidate v3 domain(s) offered.
- Whether the picker offers a single domain choice or still exposes a capability-like grouping mapped onto domains.
- v3 client codegen from the domain choice (the generators in
init/utils.tsare still v2 — see scope §4/§7generatePlaceholderClient).
Distinct from
- stash init: column picker has three usability/safety issues #396 — init column-picker usability/safety, not the v3 port.
- Adopt EQL V3 self-configuring domain types in
@cipherstash/stackschema #534 — v3 self-configuring domains in the@cipherstash/stackschema builder, a different layer from the CLI picker.
Cross-link both so they aren't conflated.
Done when
stash schema buildproduces v3 schemas/domains with no reference toSearchOp/allSearchOps.SearchOp/ColumnDefand the v2 generators are removable without breakingschema build.- Unblocks the EQL v2 removal (Remove EQL v2 repo-wide (umbrella) #707).
Activity