Docs
The project file

Databases in the file

The databases fields of clusterz.yaml, and what each kind gives your app.

An app has as many databases as it needs, each with a name of its own. Name them in the file, and every deploy starts them before the app.

databases:
  - name: main
    kind: postgres
    version: 18
    extensions: [postgis]          # PostGIS on Postgres 18
    for: [api, jobs]               # each gets DATABASE_URL
  - name: reports
    kind: postgres
    for: []                        # no one gets DATABASE_URL from it
    size: { memory_gb: 1, vcpu: 0.5 }
FieldWhat it does
databasesThe app's databases, each with its own name.
databases[].nameThe database's name: lowercase letters, digits and hyphens, up to 30 characters, starting with a letter. A service cannot share it, and app, release, postgres, auth, rest, storage and realtime are the platform's. Its services run under it on the team's network.
databases[].kindWhat it is: postgres, or supabase (Postgres with sign-in, storage and live updates). It is needed, and a file cannot change it. An app has one Supabase at most, since it answers at the app's own address.
databases[].versionA Postgres database's major version: 17, with pgvector, when left out; 16 or 18 with PostGIS. A file cannot change it.
databases[].extensionsThe Postgres extensions Clusterz creates in the database before the app starts, which the app's own login cannot. postgis picks the PostGIS image of the version, and needs version: 16 or version: 18.
databases[].forThe services given the database's variables. Left out, every service; for: [], none. Each must be a service of the file.
databases[].sizeWhat the database's own server has. It runs one instance on its volume.
databases[].size.memory_gbMemory in GB, at least 0.25. Left out, 512 MB.
databases[].size.vcpuCPU in vCPU. Left out, 0.5.
databases[].size.instancesNot taken: a database runs one instance.

What a database gives each service it is for

KindVariables
postgresDATABASE_URL (postgres://)
supabaseDATABASE_URL, SUPABASE_URL, SUPABASE_ANON_KEY, and each name your code reads them under in the browser

Two databases that would give one service the same variable are refused: leave the service out of one database's for, and give it that one under another name with from_database. A variable Clusterz set from a database leaves a service once the database is no longer for it.

A file names every database

A file never removes a database. A database the app has and the file does not name stops the deploy, with the lines to add. A database made before databases had names takes the name of the file's first database of its kind, and keeps its data, backups and address.

Databases explains what each kind is and how backups work.