You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Fix: Enable $selected access in orderBy after fn.select (#1183)
* fix: support $selected in orderBy when using fn.select
The orderBy method was only checking for regular select clause
(this.query.select) to determine if $selected should be exposed.
When using fn.select, the callback is stored in fnSelect instead,
so $selected was not available in orderBy callbacks.
This change updates orderBy to check for both select and fnSelect,
enabling queries like:
```ts
q.from({ user: usersCollection })
.fn.select((row) => ({ name: row.user.name, salary: row.user.salary }))
.orderBy(({ $selected }) => $selected.salary)
```
https://claude.ai/code/session_01EPRCG2K8348FMNWzjPiacC
* fix: extend $selected support to having method for fn.select consistency
Also adds tests for orderBy with table refs after fn.select.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: revert having change, keep only tested orderBy fix
The having method fix was made for consistency but couldn't be verified
with a passing test. Keeping only the orderBy fix which has comprehensive
test coverage.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: add $selected support for fn.select with having and fn.having
- Added fnSelect check to having method for $selected access
- Added test for fn.having with fn.select (no groupBy)
- Note: fn.select + groupBy combination requires further work
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* ci: apply automated fixes
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Fix `$selected` namespace availability in `orderBy`, `having`, and `fn.having` when using `fn.select`. Previously, the `$selected` namespace was only available when using regular `.select()`, not functional `fn.select()`.
0 commit comments