CLI
cluz db
Add a database to an app, read each one's state, and print a connection string.
| Command | What it does |
|---|---|
cluz db | Show each of the app's databases. |
cluz db add | Add a database by name and kind, for every service of the app. |
cluz db url | Print the connection string of a database, by its name. |
db also answers to database.
cluz db add main --kind postgres
cluz db add geo --kind postgres --version 18 --extension postgis
cluz db add data --kind supabase
cluz db
cluz db url -p shop main
cluz db url -p shop main --show | cluz env set -p worker DATABASE_URL --secretcluz db add --yes replaces the variables of the same names your app sets, without asking. An app whose clusterz.yaml names its databases names the new one there too, with the services it is for, or the next push refuses the file. cluz db url takes no name for an app of one database, and masks the password unless --show is given, which only the team's owners may use, and which is recorded.
Databases explains what each kind gives the app.