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: Add support for adding of relational fields #1766

Merged

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #1747

Description

Adds support for adding of relational fields to existing schema.

It does not add any syntax magic to make this easy, but it does validate that the provided values are valid (this is pretty much all it does). Any magic that we add to make the UX tolerable will need to respect these rules anyway, so no time lost there.

Similar to other aspects of the schema migration work, this also does not seek to tidy up the client.DescriptionFoo objects, but it does hope to expose and promote that cleanup in the future.

Syntax sugar and client.DescriptionFoo cleanup can/will be done later. Some hopefully within this release.

@AndrewSisley AndrewSisley added feature New feature or request area/schema Related to the schema system action/no-benchmark Skips the action that runs the benchmark. labels Aug 8, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.7 milestone Aug 8, 2023
@AndrewSisley AndrewSisley requested a review from a team August 8, 2023 18:08
@AndrewSisley AndrewSisley self-assigned this Aug 8, 2023
@AndrewSisley AndrewSisley force-pushed the 1747-add-relational-field branch 2 times, most recently from e68be5d to 029c741 Compare August 8, 2023 18:12
@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.20% 🎉

Comparison is base (cb7c25f) 75.60% compared to head (0372c5a) 75.80%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1766      +/-   ##
===========================================
+ Coverage    75.60%   75.80%   +0.20%     
===========================================
  Files          209      209              
  Lines        21900    22063     +163     
===========================================
+ Hits         16557    16724     +167     
+ Misses        4192     4189       -3     
+ Partials      1151     1150       -1     
Flag Coverage Δ
all-tests 75.80% <100.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
request/graphql/schema/errors.go 32.69% <ø> (-2.49%) ⬇️
client/errors.go 64.71% <100.00%> (+7.56%) ⬆️
db/collection.go 73.82% <100.00%> (+3.20%) ⬆️
db/errors.go 80.16% <100.00%> (+6.20%) ⬆️
db/schema.go 72.73% <100.00%> (ø)
request/graphql/schema/collection.go 92.81% <100.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb7c25f...0372c5a. Read the comment docs.

@AndrewSisley AndrewSisley force-pushed the 1747-add-relational-field branch from 029c741 to 0372c5a Compare August 8, 2023 19:15
Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

LGTM, Good job on the tests!

@AndrewSisley
Copy link
Contributor Author

LGTM, Good job on the tests!

Cheers :)

@AndrewSisley AndrewSisley merged commit 5034cdc into sourcenetwork:develop Aug 9, 2023
@AndrewSisley AndrewSisley deleted the 1747-add-relational-field branch August 9, 2023 17:44
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#1747

## Description

Adds support for adding of relational fields to existing schema.

It does not add any syntax magic to make this easy, but it does validate
that the provided values are valid (this is pretty much all it does).
Any magic that we add to make the UX tolerable will need to respect
these rules anyway, so no time lost there.

Similar to other aspects of the schema migration work, this also does
not seek to tidy up the `client.DescriptionFoo` objects, but it does
hope to expose and promote that cleanup in the future.

Syntax sugar and `client.DescriptionFoo` cleanup can/will be done later.
Some hopefully within this release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/schema Related to the schema system feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for adding relational fields to schema
2 participants