Skip to content

docs: explain assignRelationship behavior - #314

Closed
elpete wants to merge 1 commit into
nextfrom
docs/150-assign-relationship
Closed

docs: explain assignRelationship behavior#314
elpete wants to merge 1 commit into
nextfrom
docs/150-assign-relationship

Conversation

@elpete

@elpete elpete commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Issue review

Issue #150 asks Quick to document assignRelationship(), especially its ability to seed relationship data after creating records and avoid an unnecessary query.

I rate this 9/10 for Quick. The method is useful but easy to misunderstand: it controls the in-memory loaded relationship cache, not database association or persistence. Clear documentation prevents both extra queries and incorrect assumptions about foreign keys or pivot records. The only drawback is adding API detail to the repository README; the linked historical quick-docs repository has version branches but no next, so this PR keeps the requested target and the documentation beside the maintained API.

Implementation

  • Added a README section with a public creation-and-seeding example.
  • Documented singular versus collection values, replacement semantics, query avoidance, clearing, and lazy reloading.
  • Explicitly documented that assignment does not save entities, synchronize keys, attach pivot rows, or validate relationship types.
  • Expanded the method Javadoc so generated/source API documentation carries the same contract.
  • Added public-API coverage proving an assigned relationship performs no query and clearRelationship() allows one normal lazy-load query afterward.

Validation

  • Focused relationship-loading suite: 8 passed, 0 failed, 0 errors.
  • Full suite: 496 passed, 0 failed, 0 errors, 3 skipped.
  • box run-script format
  • git diff --check

Closes #150

@elpete

elpete commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator Author

Moved to the canonical Quick documentation repository as ortus-docs/quick-docs#65.

@elpete elpete closed this Aug 23, 2026
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.

1 participant