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

Use defaults from meta package for CREATE DATABASE #7119

Merged
merged 1 commit into from
Aug 11, 2016

Conversation

jsternberg
Copy link
Contributor

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.

@jsternberg jsternberg force-pushed the js-create-database-use-defaults branch from ca9fa4f to 61ae027 Compare August 8, 2016 23:05
@jsternberg jsternberg changed the title [WIP] Use defaults from meta package for CREATE DATABASE Use defaults from meta package for CREATE DATABASE Aug 8, 2016
@jsternberg jsternberg force-pushed the js-create-database-use-defaults branch from 61ae027 to 457d460 Compare August 8, 2016 23:08
@@ -2812,3 +2806,11 @@ func mustParseDuration(s string) time.Duration {
}
return d
}

func Duration(v time.Duration) *time.Duration {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@jsternberg jsternberg force-pushed the js-create-database-use-defaults branch from 457d460 to c0b7a0c Compare August 9, 2016 14:09
@e-dard
Copy link
Contributor

e-dard commented Aug 9, 2016

LGTM 👍

I think it would be worth getting at least two more review on this PR. @jwilder @corylanou @dgnorton

@jsternberg jsternberg force-pushed the js-create-database-use-defaults branch from c0b7a0c to 19302f6 Compare August 9, 2016 16:46
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.
@jsternberg jsternberg force-pushed the js-create-database-use-defaults branch from 19302f6 to 530b00b Compare August 9, 2016 17:00
@corylanou
Copy link
Contributor

👍

I would add that I would like to see more test coverage. Specifically around meta.CreateDatabaseWithRetentionPolicy as most of the edge cases are currently not tested.

screenshot 2016-08-10 17 27 30

@jsternberg jsternberg merged commit 87f7c66 into master Aug 11, 2016
@jsternberg jsternberg deleted the js-create-database-use-defaults branch August 11, 2016 15:34
@timhallinflux timhallinflux added this to the 1.0.0 milestone Dec 20, 2016
timhallinflux added a commit that referenced this pull request Dec 20, 2016
removed duplicate entry in the bugfix section.  #7119 was there 2x.
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.

4 participants