Skip to content

fix(querybuilder): preserve table metadata through generic transforms - #37

Merged
relsunkaev merged 2 commits into
mainfrom
feat/table-pipe-composition
Nov 3, 2026
Merged

relsunkaev merged 2 commits into
mainfrom
feat/table-pipe-composition

Conversation

@relsunkaev

Copy link
Copy Markdown
Owner

Preserve table metadata through callback-based native pipes. Three files; local gates pass. Merge before preparing the next patch release.

Why

Problem: applying an option after generic transforms can erase a table's field and constraint types.

  • The table already carries authoritative metadata.
  • Matching its entire recursive type to rediscover that metadata can produce widened or impossible results.

Fixes

Metadata retention:

  • Read the existing name, fields, primary keys, schema, and conflict arbiters directly.
  • Keep runtime behavior, public signatures, and Effect's piping implementation unchanged.

Regression coverage:

  • Exercise callback-based method and standalone pipes with casing and identity.
  • Check exact row and update types, ten transforms, and changing the final result type.
  • Reject invalid field values, primary-key updates, and non-unique conflict targets.
  • Construct a real query from the resulting table.

Mechanical changes:

  • Issue-tracker records accompany the source fix and tests.

Risks & Testing Needed

Scope: this fixes metadata extraction, not every inference problem.
→ Unannotated option-selector shorthand mixed with ordinary transforms remains tracked as effect-qb-ciq.

Requirement: fields and constraint facts must remain accurate after composition.
→ The new assertions fail against the merged PR #36 baseline and pass with this change.

Not tested:

  • No new claim that implicit selector inference is repaired.
  • No visual or fresh-reader usability claim.

Build status: local types, 741 tests / 80 snapshots, build, and packed Node consumer smoke tests pass.

Test Plan

bun run test:types
bun test --coverage
bun run build
bun run test:pack

CI must also pass the existing Node 22/24/26 package and database-integration jobs before merge.

Rollback

git revert -m 1 <merge-commit>

Restores the preceding typing implementation and removes these regression assertions. No data migration is involved.

Read existing metadata instead of re-inferring the recursive table shape. Cover context-bound callbacks in native pipes; implicit selector inference remains a separate issue.
@relsunkaev
relsunkaev merged commit 5ff255e into main Nov 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant