CLI reference / database / create

stado database create

Invocation

stado database create [OPTIONS] --consumer <CONSUMERS> <NAME>

Purpose

Place a fleet database, create a Supabase project, or declare an existing external server. The default provider is `fleet`: Stado runs postgres (default) or sqlite (`--engine sqlite`) on one fleet host -- the vault owner unless `--host` names another -- with no vendor and no bill, through `stado database place` on that host. `supabase` creates a hosted Postgres project in the organization and region of `--anchor`'s project, or, without it, the one organization and region every project the token sees shares, and refuses unless `--accept-monthly-usd` covers what one more project adds to the compute bill. `external` brings a server of any engine the user already runs anywhere (Postgres, MySQL, MongoDB, Redis, SQL Server, ...; RDS, Cloud SQL, Neon, PlanetScale, Atlas, Azure, their own server): the connection URL is read from standard input and names the engine, and `--ca-certificate` names the server's certificate authority. Every way, the credential item `<name>-database` is written into the owner vault and the database is declared for its consumers. A fleet or supabase database of that name is reused, never duplicated; an external one is re-pointed at the URL given. The database name and consumer identities are checked before placement, provider requests or credential writes. An invalid name or consumer identity exits with code 2 and names the rejected value before any database is created or its credential item is rewritten.

Required inputs and options

Input or optionContract
<NAME>Logical database name (lowercase letters, digits, dashes)
--consumer <CONSUMERS>Consumer allowed to resolve this database
--engine <ENGINE>Engine the database speaks. Fleet: postgres (default) or sqlite; supabase: postgres; external: the connection URL's engine, which --engine only confirms
--provider <PROVIDER>Who runs it: fleet (Stado, on a fleet host), supabase, or external (an existing server of any engine; URL on stdin) Possible values: - fleet: Stado, on a fleet host - supabase: A hosted Supabase project - external: An existing server of any engine Stado does not run [default: fleet]
--ca-certificate <CA_CERTIFICATE>Certificate authority bundle (PEM) of an external server (external)
--host <HOST>Fleet host the database is placed on (fleet; default: the vault owner)
--port <PORT>Port the fleet database listens on (fleet postgres; required there: Stado assumes none)
--anchor <ANCHOR>Declared database whose project's organization and region the new project joins (supabase); without it, the one organization and region every project the token sees shares
--accept-monthly-usd <ACCEPT_MONTHLY_USD>Monthly compute cost in USD the operator accepts for the new project (supabase)
--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

  • Port the fleet database listens on (fleet postgres; required there: Stado assumes none)
  • 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.