-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Use defaults from meta
package for CREATE DATABASE
#7119
Conversation
ca9fa4f
to
61ae027
Compare
meta
package for CREATE DATABASE
meta
package for CREATE DATABASE
61ae027
to
457d460
Compare
@@ -2812,3 +2806,11 @@ func mustParseDuration(s string) time.Duration { | |||
} | |||
return d | |||
} | |||
|
|||
func Duration(v time.Duration) *time.Duration { |
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.
Can you keep golint happy with some comments, or maybe even better move these to pkg
or somewhere? Or alternatively make them unexported?
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 moved them to private functions although I think I'll move them to pkg
in the future. I just didn't want to go through the effort right now.
457d460
to
c0b7a0c
Compare
LGTM 👍 I think it would be worth getting at least two more review on this PR. @jwilder @corylanou @dgnorton |
c0b7a0c
to
19302f6
Compare
Instead of having the parser set the defaults, the command will set the defaults so that the constants for that are actually used. This way we can also identify which things the user provided and which ones we are filling with default values. This allows the meta client to be able to make smarter decisions when determining if the user requested a conflict or if the requested capabilities match with what is currently available. If you just say `CREATE DATABASE WITH NAME myrp`, the user doesn't really care what the duration of the retention policy is and just wants to use the default. Now, we can use that information to determine if an existing retention policy would conflict with what the user requested rather than returning an error if a default value ever gets changed since the meta client command can communicate intent more easily.
19302f6
to
530b00b
Compare
removed duplicate entry in the bugfix section. #7119 was there 2x.
Instead of having the parser set the defaults, the command will set the
defaults so that the constants for that are actually used. This way we
can also identify which things the user provided and which ones we are
filling with default values.