Skip to content

stash schema build: port the v2 capability column picker to EQL v3 domains #751

Description

@tobyhede

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:9export type SearchOp = 'equality' | 'orderAndRange' | 'freeTextSearch'
  • packages/cli/src/commands/init/lib/introspect.ts:102allSearchOps() produces SearchOp[]
  • .../introspect.ts:119selectTableColumns(), with the p.multiselect column picker at :147 and the searchable flow at :175
  • .../introspect.ts:197buildSchemasFromDatabase()
  • packages/cli/src/commands/schema/build.ts:5,58,65schema build calls buildSchemasFromDatabase() then generateClientFromSchemas()

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.ts are still v2 — see scope §4/§7 generatePlaceholderClient).

Distinct from

Cross-link both so they aren't conflated.

Done when

  • stash schema build produces v3 schemas/domains with no reference to SearchOp/allSearchOps.
  • SearchOp / ColumnDef and the v2 generators are removable without breaking schema build.
  • Unblocks the EQL v2 removal (Remove EQL v2 repo-wide (umbrella) #707).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions