Skip to content

Test scoped subselects when using all - #336

Open
elpete wants to merge 1 commit into
nextfrom
test/60-subselect-scopes-all
Open

Test scoped subselects when using all#336
elpete wants to merge 1 commit into
nextfrom
test/60-subselect-scopes-all

Conversation

@elpete

@elpete elpete commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #60

Issue review

Recommendation: 8/10 — preserve and test. .all() and .get() should hydrate the same selected fields; differing behavior is surprising and breaks substitutability. The only downside is a small additional integration test.

Reproduction note

The reported failure could not be reproduced on current next with qb@14.0.0-beta.3. A withLatestPostId() scope followed by .all() hydrates the subselected virtual attribute correctly and executes one query.

Implementation

  • adds a public-API regression for a scoped subselect followed by .all()
  • asserts the full collection is returned
  • asserts the projected value is available from the hydrated entity getter
  • asserts only one database query is executed

Validation

  • focused SubqueriesSpec: 12 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