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
{{ message }}
Repository navigation
Commit f8567e5
Browse filesBrowse the repository at this point in the historyBrowse files
fix(joins): return joined internal attributes for alias.* and joined orders
select(['alias.*']) stood for the join's implicit projection (the joined
$id and attributes), so it never returned the joined $sequence, $createdAt,
$updatedAt or $permissions a direct read of the joined collection returns.
On a left, right or full outer join it also lost alias.$id: the Database
layer treated alias.* as not selecting the joined $id, selected it only to
tell unmatched rows apart and stripped it from the result, so the next page
threw "Cursor has no value for order attribute 'alias.$id'".
A read ordered by a joined internal attribute (alias.$sequence,
alias.$createdAt) without a named select could not page either: the
implicit projection leaves joined internals out, so no returned row carried
the order value its cursor needs. select(['*', 'alias.$createdAt']) did not
help because any '*' replaced the whole select with the implicit projection,
silently dropping the named joined columns.
alias.* now returns the joined row as a direct read does: $id, $sequence,
$createdAt, $updatedAt and $permissions next to the attributes. $tenant stays
out (it is the read's own tenant, and callers strip only the main $tenant
before responding); it remains selectable by name. A read without a select
or with '*' projects the joined columns its order names and the joined
columns named next to '*', on every SQL engine and in both halves of the
UNION ALL full outer join emulation, so its rows page in both directions.
Only the projection changes: the order, tie keys and the MariaDB bounded
join page are untouched, so no read gains a sort. The implicit projection
without such an order keeps its documented shape. An unmatched outer row's
alias.$permissions is null like its other joined values instead of [].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments