-
Notifications
You must be signed in to change notification settings - Fork 13
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
Non interactive databases take two #151
Non interactive databases take two #151
Conversation
a799e99
to
5998861
Compare
You're amazing inline docs clear this up:
|
chuickle but this does identify the non-obviousness of the syntax, especially since I did wonder about using magic expressions such as |
src/commands/deploy.rs
Outdated
/// do not exist will be created. To express "create a new database with | ||
/// a random name", use the special database '*'. To link all labels | ||
/// not specified in other --link flags, use the special label '*'. | ||
/// Thus, 'sqlite:*=*' would create a new randomly named database for |
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 did wonder about using magic expressions such as sqlite:default=new(). I am not sure if that is better or worse. Or what the syntax for "for databases not explicitly listed..." would look like.
One thing i wonder is whether we should move the wildcard cases *
to a separate PR while we talk it out and for now go with the requirement of specifying database and label names. I think the *
is fairly sound but in *=
, the *
acts differently than =*
namely, one means "any (label) that exists" and the other means "create a new db for each". Overall, the label wildcard makes more sense to me as being desired in non-interactive scenarios.
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.
@kate-goldenring That's a wise call. Thanks!
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
5998861
to
9d0b8c5
Compare
@kate-goldenring updated |
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
9d0b8c5
to
0ba2cfc
Compare
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.
Thank you @itowlson!
This is another take on #125 (cf. #126). It's significantly more complicated than #126, but aims to be more explicit.
I am not delighted with the CLI experience in this initial draft. This looks like:
Here the
sqlite:
prefix says what the label refers to (to allow for K/V or other resource linking in future), and*
is a magic symbol for "create a new and link that". This is a lot more verbose than @kate-goldenring's example syntax in #126 (comment) and perhaps the future-proofing is too speculative, I'm not sure; and of course magic symbols are never great for discoverability.That said, I'm optimistic about the principle of using a strategy object, and I think I've separated the CLI parsing reasonably cleanly from the strategy object itself, so maybe we can iterate on this and find an experience that folks are happy with?
(Oh yeah there are a whole lot more tests need writing but the mocks had turned my brain to sausage so I'll do them later.)