Skip to content

Add without for configured eager loads - #345

Open
elpete wants to merge 1 commit into
nextfrom
feat/48-without-eager-loads
Open

Add without for configured eager loads#345
elpete wants to merge 1 commit into
nextfrom
feat/48-without-eager-loads

Conversation

@elpete

@elpete elpete commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #48

Issue review

Recommendation: 9/10 — implement. Automatic eager loading is useful as an entity default, but individual queries need a straightforward escape hatch to avoid unnecessary joins/queries or large relationship graphs. This mirrors the control Quick already provides for global scopes. The only meaningful downside is another query-builder state operation to understand.

Implementation

  • adds .without() to clear all configured eager loads
  • adds .without(nameOrArray) to remove selected eager loads
  • removes nested branches when their parent is excluded
  • supports both string eager loads and callback-configured eager loads
  • remains chainable, so callers can remove defaults and add different explicit eager loads afterward

Test-first evidence

The public regression initially errored with QuickMissingMethod. It now disables the automatic comments eager load on EagerLoadedPost, confirms the relationship is not loaded, confirms lazy-loading protection fires, and confirms only the base posts query runs.

Validation

  • focused EagerLoadingSpec: 28 passed, 0 failed, 0 errors
  • full Lucee 6 suite: 496 passed, 0 failed, 0 errors, 3 skipped
  • box run-script format
  • git diff --check

Uses qb@14.0.0-beta.3.

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