Skip to content

fix: nested join aliases, add a Spec::between() factory - #59

Merged
kbond merged 3 commits into
zenstruck:1.xfrom
kbond:fix/misc-issues
Aug 20, 2026
Merged

kbond merged 3 commits into
zenstruck:1.xfrom
kbond:fix/misc-issues

Conversation

@kbond

@kbond kbond commented Aug 20, 2026

Copy link
Copy Markdown
Member

Three unrelated issues found in the audit, one commit each.

  • Nested join aliases collided. A nested join defaulted its alias to the relation name, so Join::inner('relation')->scope(Join::inner('entities')->scope(Join::inner('relation'))) failed with [Semantical Error] ... 'relation' is already defined. Nested aliases are now prefixed with their parent's (relation_entities, relation_entities_relation); an explicit alias is never touched. While in there, an anti-join now returns its expression instead of calling andWhere() itself, so it composes correctly inside orX() - previously it was applied unconditionally.
  • Util::stringify() returned a Stringable from a method declared : string. Harmless today only because this package doesn't declare strict types.
  • Added Spec::between(), so Between is no longer the only filter you have to construct directly. README updated.

kbond added 3 commits August 20, 2026 14:07
A nested join defaulted its alias to the relation name, so joining relations with the same name on different parents failed with "'x' is already defined". Nested aliases are now prefixed with their parent's, and an anti-join returns its expression so it composes correctly inside `orX()`.
`Util::stringify()` returned the `Stringable` itself from a method declared `: string` - it only worked because this package doesn't declare strict types.
`Between` was the only filter you had to construct directly.
@kbond
kbond merged commit 1db4817 into zenstruck:1.x Aug 20, 2026
18 checks passed
@kbond
kbond deleted the fix/misc-issues branch August 20, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant