CLI reference / database / destroy

stado database destroy

Invocation

stado database destroy [OPTIONS] <NAME>

Purpose

Destroy a database Stado created: the inverse of `create`. A fleet database: removes the managed unit `<name>-database` that serves a postgres database on its host; its data directory `~/.stado/databases/<name>/` is left in place and named. A Supabase database: deletes the hosted project with every row it holds, and only with `--delete-project`. Then the credential item is deleted from the owner vault (restorably, as Skarbiec deletes) and the declaration is withdrawn last, so a run that stops part-way can be run again. An external database is a server Stado does not run: it is refused, and `remove` withdraws its declaration. On the vault owner, provider metadata is read with the owner's keys, without a workload bearer. Other hosts require access to the named credential item; hosted-provider API authorization is still required.

Required inputs and options

Input or optionContract
<NAME>Positional input; required or optional as shown in the invocation.
--host <HOST>Host the database was placed on (default: the vault owner, where `create` places it)
--delete-projectRequired for a Supabase database: its hosted project and every row in it are deleted and cannot be restored
--jsonEmit machine-readable output

Output and state effect

It performs the operation described above and emits its operator result on standard output or standard error. Any state change is limited to the resources and records named by the purpose and options on this page.

Refusals

  • Required for a Supabase database: its hosted project and every row in it are deleted and cannot be restored
  • Before dispatch, Stado refuses a missing required token shown in the invocation, an unknown option, or a value outside a listed value set; argument-usage failures exit with code 2.