refactor(sql): drop empty execute() stubs and dead root-alias helpers - #788
Conversation
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.
|
Warning Review limit reached
Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (17)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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 emptyexecute() {}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 markedoverride(required bynoImplicitOverrideonce the base member is concrete — pagination already carried it).B — delete the dead
RootAliasFnfamily.RootAliasFn(src/types.ts),toRootAliasFn+isRootAliasFn(src/helpers/root-alias.ts) were unreferenced anywhere in the monorepo — the in-use root alias is the plainstringoption — andRootAliasFnstill carried theTARGETgeneric that the execute() redesign removed from the package, marking it as a fossil of the pre-redesign API. Both files are deleted along with thehelpers/index.tsre-export.toRootAliasFn/isRootAliasFnwere 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. (RootAliasFnitself was never reachable from the barrel —src/index.tsnever 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/typeorminto a@rapiq/sqlbase. Decision recorded here so the plan can be closed.Testing
nx run @rapiq/sql:build+nx run @rapiq/typeorm:buildgreen