feat: add ORM relationships, collections, and query specifications#28
Merged
feat: add ORM relationships, collections, and query specifications#28
Conversation
7fe6c89 to
0c52237
Compare
…ecifications to database package Extends the Data Mapper database layer with explicit relationship loading, typed entity collections, and composable query specifications — no lazy loading, no proxies, no magic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Production mode must be opt-in (MARKO_ENV=production) rather than the silent default. When no env var is set, show full error details to align with the loud errors principle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The RepositoryInterface return types changed from array to EntityCollection, so test stubs implementing the interface need to match. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The awk-based sync script failed on multiline variables, leaving dropdowns empty after each sync. Replaced with portable shell loop that works on both macOS and Linux. Populated both templates with all 71 packages. Also defaults error handler to development mode when no MARKO_ENV is set (loud errors by default). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0c52237 to
da19791
Compare
…er rebase Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
EntityMetadataFactory now validates EntityCollection (not just array) for HasMany/BelongsToMany properties. RelationshipLoader wraps loaded entities in EntityCollection when the target property is typed as such. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#[HasOne],#[HasMany],#[BelongsTo],#[BelongsToMany]) for declaring entity relationships via PHP attributeswith()on Repository and RepositoryQueryBuilder — no lazy loading, no proxies, no N+1 by design'comments.author')EntityCollection— typed, chainable collection with filter, map, sort, group, chunk, pluckQuerySpecificationinterface andmatching()for composable, named query logic (replaces Eloquent scopes)findAll()/findBy()return types fromarraytoEntityCollectionTest plan
Closes #24
🤖 Generated with Claude Code