Skip to content

refactor(sql): drop empty execute() stubs and dead root-alias helpers - #788

Merged
tada5hi merged 1 commit into
masterfrom
refactor-adapter-execute-followups
Jul 20, 2026
Merged

refactor(sql): drop empty execute() stubs and dead root-alias helpers#788
tada5hi merged 1 commit into
masterfrom
refactor-adapter-execute-followups

Conversation

@tada5hi

@tada5hi tada5hi commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Motivation

Resolves the adapter execute() follow-up cleanups deferred from the #754 audit (local plan 015) — one PR for the whole plan.

Changes

A — collapse the empty execute() sub-adapter stubs. Plain SQL never applies to a target: Adapter.execute() reads the accumulated fragments (getColumns()/getQueryAndParameters()/getOrderBy()/getPaths()) directly, so the five concrete SQL sub-adapters carried empty execute() {} bodies that were never called. The shared base classes now provide a concrete no-op default and the five empty overrides are deleted. The typeorm sub-adapters keep their real apply-step overrides, now marked override (required by noImplicitOverride once the base member is concrete — pagination already carried it).

B — delete the dead RootAliasFn family. RootAliasFn (src/types.ts), toRootAliasFn + isRootAliasFn (src/helpers/root-alias.ts) were unreferenced anywhere in the monorepo — the in-use root alias is the plain string option — and RootAliasFn still carried the TARGET generic that the execute() redesign removed from the package, marking it as a fossil of the pre-redesign API. Both files are deleted along with the helpers/index.ts re-export.

⚠️ toRootAliasFn/isRootAliasFn were part of the public export surface (via ./helpers); removing them is technically breaking. Nothing consumes them, and the 2.0 beta window is the right time to shed them before GA freezes the surface. (RootAliasFn itself was never reachable from the barrel — src/index.ts never exported ./types.)

C — shared BaseRootAdapter: closed as won't-do. After the Stance-B redesign the duplicated root prologue is down to two statements (clear-if-opted + visitor walk); that doesn't justify cross-package class inheritance from @rapiq/typeorm into a @rapiq/sql base. Decision recorded here so the plan can be closed.

Testing

  • nx run @rapiq/sql:build + nx run @rapiq/typeorm:build green
  • sql: 101/101 tests, typeorm: 94/94 tests
  • eslint clean on all changed files
  • No behavioral change: the removed stubs were never called; the no-op default renders the same

The five SQL sub-adapter execute() stubs did nothing: plain SQL never
applies to a target, the root adapter reads the accumulated fragments
directly. The shared base classes now provide a concrete no-op default
and the empty overrides are removed; the typeorm sub-adapters keep
their real overrides (now marked override).

RootAliasFn, toRootAliasFn and isRootAliasFn were unreferenced across
the monorepo (the in-use root alias is the plain string option) and
still carried the TARGET generic removed from the package in the
execute() redesign. The helpers were publicly exported; their removal
is a breaking change to the export surface, shipped during the 2.0
beta window.
Copilot AI review requested due to automatic review settings July 20, 2026 07:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@tada5hi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 86ec1d26-d28c-4296-a788-1bc46cb1bb1b

📥 Commits

Reviewing files that changed from the base of the PR and between 340f6e6 and f8a0d56.

📒 Files selected for processing (17)
  • packages/sql/src/adapter/fields/base.ts
  • packages/sql/src/adapter/fields/module.ts
  • packages/sql/src/adapter/filters/base.ts
  • packages/sql/src/adapter/filters/module.ts
  • packages/sql/src/adapter/pagination/base.ts
  • packages/sql/src/adapter/pagination/module.ts
  • packages/sql/src/adapter/relations/base.ts
  • packages/sql/src/adapter/relations/module.ts
  • packages/sql/src/adapter/sort/base.ts
  • packages/sql/src/adapter/sort/module.ts
  • packages/sql/src/helpers/index.ts
  • packages/sql/src/helpers/root-alias.ts
  • packages/sql/src/types.ts
  • packages/typeorm/src/adapter/fields.ts
  • packages/typeorm/src/adapter/filters.ts
  • packages/typeorm/src/adapter/relations.ts
  • packages/typeorm/src/adapter/sort.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor-adapter-execute-followups

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tada5hi
tada5hi merged commit 07fd6f3 into master Jul 20, 2026
7 checks passed
@tada5hi
tada5hi deleted the refactor-adapter-execute-followups branch July 20, 2026 08:42
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.

2 participants