Skip to content

Add binary UUID relationship support#143

Merged
michaeldyrynda merged 7 commits intomichaeldyrynda:mainfrom
abkrim:feature/binary-uuid-relationships
Mar 19, 2026
Merged

Add binary UUID relationship support#143
michaeldyrynda merged 7 commits intomichaeldyrynda:mainfrom
abkrim:feature/binary-uuid-relationships

Conversation

@abkrim
Copy link
Contributor

@abkrim abkrim commented Oct 13, 2025

Implements BinaryUuidBuilder to enable Eloquent relationships when using EfficientUuid cast with BINARY(16) storage. Addresses issue #65.

Features:

  • Custom query builder that converts UUID strings to binary automatically
  • Opt-in via UsesBinaryUuidBuilder trait
  • Full support for belongsTo, hasMany, hasOne relationships
  • Eager loading support (with, whereIn queries)
  • whereNotIn support for exclusion queries

Testing:

  • 22 new comprehensive tests (78 total, 144 assertions)
  • 100% backward compatible - all existing tests pass
  • Edge cases covered (invalid UUIDs, empty arrays, qualified columns)
  • Complex query scenarios tested

Implementation:

  • Zero performance penalty for non-UUID queries
  • Strict type checking (PHPStan ready)
  • No breaking changes to existing functionality

abkrim and others added 6 commits March 19, 2026 10:56
Implements BinaryUuidBuilder to enable Eloquent relationships when using
EfficientUuid cast with BINARY(16) storage. Addresses issue michaeldyrynda#65.

Features:
- Custom query builder that converts UUID strings to binary automatically
- Opt-in via UsesBinaryUuidBuilder trait
- Full support for belongsTo, hasMany, hasOne relationships
- Eager loading support (with, whereIn queries)
- whereNotIn support for exclusion queries

Testing:
- 22 new comprehensive tests (78 total, 144 assertions)
- 100% backward compatible - all existing tests pass
- Edge cases covered (invalid UUIDs, empty arrays, qualified columns)
- Complex query scenarios tested

Implementation:
- Zero performance penalty for non-UUID queries
- Strict type checking (PHPStan ready)
- No breaking changes to existing functionality
@michaeldyrynda michaeldyrynda force-pushed the feature/binary-uuid-relationships branch from 3a2cf74 to e5e437e Compare March 19, 2026 01:08
@michaeldyrynda michaeldyrynda merged commit d02422e into michaeldyrynda:main Mar 19, 2026
7 checks passed
@michaeldyrynda
Copy link
Owner

Thanks @abkrim

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.

2 participants