-
Notifications
You must be signed in to change notification settings - Fork 54
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: Allow new fields to be added locally to schema #1139
Changes from all commits
eb7c28b
e71a52d
5eb5495
4377581
05d5078
362d204
7f6f92d
4b5d326
e8978ce
12fb03e
adf435b
27093dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import ( | |
|
||
"github.com/sourcenetwork/defradb/client" | ||
"github.com/sourcenetwork/defradb/client/request" | ||
"github.com/sourcenetwork/defradb/datastore" | ||
) | ||
|
||
// SchemaDefinition represents a schema definition. | ||
|
@@ -49,5 +50,5 @@ type Parser interface { | |
ParseSDL(ctx context.Context, schemaString string) ([]client.CollectionDescription, error) | ||
|
||
// Adds the given schema to this parser's model. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: Is the documentation still valid for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, what it does conceptually has not changed. The only difference is that changes will only be applied if/until the txn is successfully committed. The doc could probably be expanded to mention this (although it is somewhat a universal implicit-given for anything transaction-based), but it is internal, not public, and if left up to me laziness would probably win out. Do you want it expanded? |
||
AddSchema(ctx context.Context, collections []client.CollectionDescription) error | ||
SetSchema(ctx context.Context, txn datastore.Txn, collections []client.CollectionDescription) error | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion:
UpdateCollection
should take a name (string) as a parameter to make it clear what is the intended "collection" youre trying to update.Obviously the description itself has the name too, but it should be more explicit from an API perspective.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this quite strongly and it creates additional points of failure and confusion where the
name
parameter does not pair up with the description. Such a param can also be added later if we feel the need.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really convinced by that argument, but looking at the current system,
CreateCollection
also doesn't take a named value, so its good for now 👍.