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

Enable updating a link with spin cloud link sqlite #123

Merged

Conversation

kate-goldenring
Copy link
Collaborator

Currently, to change the database linked to an app with a label, you have to unlink and then link.

$ spin cloud link sqlite --app boo-todo --database newname default
Error: Database "newdb" is already linked to app "boo-todo" with label "default"
$ spin cloud unlink sqlite --app boo-todo default
Database 'newdb' no longer linked to app boo-todo
$ spin cloud link sqlite --app boo-todo --database newname default
Database 'newname' is now linked to app 'boo-todo' with the label 'default'

With change, do not need to unlink to change a link.

$ spin cloud link sqlite --app boo-todo --database newname default
Database "newdb" is already linked to app "boo-todo" with label "default". Link to database "newname" instead? yes
Database "newname" is now linked to app "boo-todo" with the label "default"

Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The request changes is for the prompt - the other comment is a flag for the future.

It's out of scope for this PR, but this reminded me that at some point we need to revisit this stuff to make it scripting/CI friendly. We've built the experience for interactive users but if someone runs it in CI then either it's going to block forever or the interactions will error out because no terminal (I am not sure if dialoguer checks for this case). Like I say, out of scope for this but something to ponder after 0.4 is out maybe.

src/commands/link.rs Show resolved Hide resolved
src/commands/link.rs Outdated Show resolved Hide resolved
Signed-off-by: Kate Goldenring <kate.goldenring@fermyon.com>
@kate-goldenring
Copy link
Collaborator Author

We've built the experience for interactive users but if someone runs it in CI then either it's going to block forever or the interactions will error out because no terminal (I am not sure if dialoguer checks for this case). Like I say, out of scope for this but something to ponder after 0.4 is out maybe.

@itowlson I naively thought dialoguer's defaults handle this, but i see it does not based on our avoidance of it in spin https://github.com/kate-goldenring/spin/blob/0ed4c8234f16f525b642309ebe086dff4567ebcc/src/commands/plugins.rs#L483

@kate-goldenring kate-goldenring merged commit f827728 into fermyon:main Oct 5, 2023
8 checks passed
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.

None yet

3 participants