You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(table): make name→storage predicate translation one operation
The block's own filter — {"all":[{"field":"Color","op":"contains","value":"Teal"}]}
— returned 0 rows against a table where 15 rows hold Teal.
Translating a name-keyed predicate to storage keys is two steps: column names →
column ids, and select operands → option ids. Both are required, neither is
useful alone, but they were two separate calls each boundary had to remember to
pair. Three did not: the internal query route (the table_v2 block's own path),
the bulk update/delete resolver, and — before this branch — nothing else needed
it, so the gap was invisible until select columns landed.
Replaced with a single `predicateToStorage(predicate, schema)` and migrated
every call site, so the pair cannot be split again. `predicateNamesToIds` now
has no direct callers outside it.
Also fixes four type errors that a failed inference in contracts/tables.ts was
masking — once the leaf schema type-checked, tsc surfaced the rest:
- `ColumnType` was imported from lib/table/types but never exported there (it
lived as a local alias in sql.ts). Now exported once, next to ColumnDefinition.
- rows/service.ts referenced TableRowsCursor in three signatures without
importing it.
- export-runner and snapshot-cache still declared their paging cursor's orderKey
as non-null, after selectExportRowPage was corrected to return the nullable it
always had.
- the predicate leaf's `z.unknown()` value infers wider than Predicate['value'];
narrowed with an annotated cast, runtime unchanged.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011M563cbFy2S74GvSDf2C3R
0 commit comments