`supabase restart` command
Feature request
Is your feature request related to a problem? Please describe.
I have found myself, when debugging initial migrations, wanting to do supabase stop and supabase start right after one another.
For convenience, it would be nice to have a supabase restart command, equivalent to supabase stop && supabase start in a UNIX system.
Hmm, I'm not sure this warrants a new command. Wouldn't a shell alias or command history + completion do a better job?
cc @parrotmac
This could definitely by an x, y problem, so I’ll expand on my situation.
I recently work on taking an existing (pre-Go-cli) project and migrating it to be usable locally. I found myself trying something, getting an error when running “supabase start”, making a tweak, then instinctively running “supabase start” again to test the changes. However, I’d get an error because the project was already “up” (but broken).
As I’m thinking about it more, perhaps an alternative approach is to have the CLI tear-down resources upon error. IMHO this would be more expected.
Another option could be to provide a “reinit” sort of command that’s targeted at just rebuilding the DB portion of the stack.
Got it, thanks for sharing your situation! The CLI should be tearing down resources on error, but I also noticed this sometimes doesn't work, specifically when there is an error during db startup. Do you mind creating another issue to track this?
I use a quick shell script to do something similar which is handy for running supabase locally with an npm script.
#!/bin/bash
supabase start
finish()
{
supabase stop
exit
}
trap finish SIGINT
while :; do
sleep 60
echo "Supabase heartbeat..."
done
Closing this as we decided to fix the underlying issue instead. supabase start && supabase stop is expected to properly tear down existing containers.