stado database adopt
Invocation
stado database adopt [OPTIONS] [NAME]Purpose
Bring a declared database's credential item in line with its hosted Supabase project. Rewrites `<name>-database` from the management API: coordinates, pooler with its transaction-mode `pooler_url` and session-mode `session_url`, the revealed API keys (legacy `anon_key` and `service_role_key`, every named key as `publishable_key_<name>` or `secret_key_<name>`) and an active custom hostname as `custom_url`. Fields another owner put on the item stay, and the password is kept from the item, read from --password-file, or, with --rotate-password, replaced: a new one is set on the project through the management API and written on the item, for a project whose password no item holds. Without NAME, every declared database whose item records a Supabase `project_ref` is adopted again, so a rotated key lands. Items are read and written in the owner vault, from any host: off the owner through the host channel. --check writes nothing and exits non-zero when an item differs.
Required inputs and options
| Input or option | Contract |
|---|---|
[NAME] | Declared database to adopt; every Supabase-backed one when omitted |
--project-ref <PROJECT_REF> | The Supabase project ref, when the item does not record it yet |
--password-file <PASSWORD_FILE> | File whose whole content is the database password |
--rotate-password | Set a new database password on the Supabase project and store it on the item. Every client still using the old password loses its connection |
--check | Report drift and write nothing; exit non-zero on drift |
--json | Emit 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
- Report drift and write nothing; exit non-zero on drift
- 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.