Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat relationships #246

Merged
merged 196 commits into from
Apr 11, 2023
Merged

Feat relationships #246

merged 196 commits into from
Apr 11, 2023

Conversation

abnegate
Copy link
Member

@abnegate abnegate commented Mar 12, 2023

What's changed

  • Add create/update/delete relationship attributes
  • Allow creating documents with relationships, either with existing document ID's or nested documents. If nested documents do not exist, they are created. They are updated if they already exist and the data is different.
  • Add fetching documents with relationships. Allows nesting up to a maximum level.
  • Add updating documents with relationships.
  • Add deleting documents with relationships.
  • Allow querying documents with relationships. Will filter parent documents based on child attributes. Uses dot-paths to specify child attributes. E.g. For a one-to-many, author to posts relationship Query::equal('posts.title', ['Post 1']) will return all authors that have at least one post where the title equals 'Post 1'.
  • Allow selecting attributes from child relationships. Must either select some or all parent attributes, defaults to all. Uses dot-paths to specify child attributes. Can use wildcard * to specify selection of all a relationships attributes. E.g. Query::select(['posts.title']) or Query::select(['posts.*']) if parent attributes are selected, and relationship attributes are not, relationships are not fetched.

Test Plan

  • Added tests covering CRUD for relationship attributes of all types, and CRUD for documents for each type, as well as querying and selecting.
  • Performance testing and benchmarking

Copy link
Contributor

@christyjacob4 christyjacob4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just some more questions

@abnegate abnegate force-pushed the feat-relationships branch from ffc446b to c84d5fb Compare April 5, 2023 14:42
@abnegate abnegate requested a review from christyjacob4 April 10, 2023 07:23
@abnegate abnegate requested a review from christyjacob4 April 10, 2023 10:17
Copy link
Contributor

@christyjacob4 christyjacob4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@abnegate abnegate merged commit f162c14 into main Apr 11, 2023
@abnegate abnegate deleted the feat-relationships branch November 23, 2023 01:51
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.

6 participants