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

Add db reset command #212

Open
cllns opened this issue Jul 19, 2024 · 2 comments
Open

Add db reset command #212

cllns opened this issue Jul 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@cllns
Copy link
Member

cllns commented Jul 19, 2024

We should have a db reset command that does drop then create then prepare (maybe can avoid the 'create' since prepare can do that too)

Original:

It'd be nice to able to do:

HANAMI_ENV=test hanami db drop create prepare

Instead, now this only drops the DB and ignores the other args.

@cllns cllns added the enhancement New feature or request label Jul 19, 2024
@timriley
Copy link
Member

timriley commented Jul 21, 2024

This is an interesting idea! But I'd also be worried about leading to misunderstandings about how the rest of the CLI commands work (where we would support no such chaining).

My preference would be to double down on something like "db prepare" and make sure it's truly a one-stop command to go from zero to fully ready database.

And then if someone wants to chain it with db drop, they can use seperate &&-combined shell commands. After all, this is what the shell is there for!

Perhaps your desire to do a single-operation drop->create->prepare is motivation for us to create a single db reset command that does all that together? (and which will only ever work in dev/test environments only).

@cllns
Copy link
Member Author

cllns commented Jul 23, 2024

Yea that's fair! db reset seems like the best solution. Changing the title of this issue

@cllns cllns changed the title Support multiple db commands at once Add db reset command Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Not now
Development

No branches or pull requests

2 participants