feat: fill relationships on new entities - #303
Open
elpete wants to merge 3 commits into
Open
Conversation
elpete
force-pushed
the
feat/179-fill-new-entity-relationships
branch
from
August 23, 2026 14:16
fec5ef7 to
60597ba
Compare
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.
Closes #179
Issue review
Recommendation: 8/10 for in-memory aggregate construction; not for implicit aggregate persistence. Building a relationship graph before persistence is a strong fit for Quick because it enables validation and removes an artificial create/update difference. Automatically saving that graph is not a fit: Quick intentionally makes persistence boundaries explicit, and a cascading
save()would look too much like a unit-of-work API while lacking those guarantees.Behavior
fill()on a new entity accepts relationship data.create()/save()persists only the root entity.Test-first revision
I first changed the public
create()regressions to require root-only persistence. Against the prior cascading implementation, the focused run had 14 passes and 2 failures: child entities were loaded/persisted, and belongs-to-many identifiers had been resolved and attached. After removing deferred relationship writes, all 16 focused specs pass.The existing public
fill()regression also verifies that an entity and a child struct both become unloaded Quick entities in the cached relationship graph.Validation
CreateSpec,FillSpec, andGoodErrorMessagesSpecsuites have 16 passed, 0 failed, 0 errors.box run-script formatgit diff --checkDependency:
qb 14.0.0-beta.3.