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.
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 Proto Columns DDL #2277
feat: add support for Proto Columns DDL #2277
Changes from 1 commit
b95f577
1653916
88cb28d
75a23de
f738af6
a1b5ab0
678e8ee
e85e350
bb04177
f4c7c96
80526b5
88fa533
d33f816
fb0293a
c45143c
7c6472d
50b8666
72af9f3
e355e4a
eb938bc
f762e39
30be84a
70acee6
51a4031
bfae4ad
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Sorry, I didn't notice this during the last review, but this seems a little strange. It is a method in the
Database
class and takes aDatabase
instance as an argument. Why does it not just operate on this database?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.
The reason it cannot operate on this database is because a user cannot set
ProtoDescriptor
directly to Database Class assetProtoDescriptors
method belongs toDatabase.Builder
. Below is a small example to illustrate this,So a new Database instance has to be passed to update the ProtoDescriptor field. However, I agree that this is incorrect and confusing at same time.
Another Approach
@olavloite Please validate if below is more meaningful to do.
Expose a new method
toBuilder()
inDatabase.java
that return a Builder of thatDatabase
instance. This allows users tosetProtoDescriptor
by calling the builder.The change in
Database.java
isThe user can use it like below
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.
Hmmm.... If the
protoDescriptors
field is not something that is actually part of theDatabase
class and thereby also not stored with the database, and is only needed for the update method, then we need to add it as an argument to the method afte rall. Other approaches would be non-idiomatic Java.So the signature of the method would then become
Database#updateDatabaseDdl(Iterable<String> statements, String protoDescriptors, String operationId)
. Another option would be to create aDatabaseUpdateOptions
class that contains all possible update options, the first one beingprotoDescriptors
(that would make it more easily reusable for additional options in the future).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 agree with you @olavloite. Creating a new
DatabaseUpdateOptions
class that can update options will help us reuse in future. I will take this effort as part of the next PR. I will tag this comment in the other PR later to understand the need of that change.