dibbla db
Provision managed Postgres databases, connect through the Dibbla proxy, and dump/restore using `pg_dump` custom-format archives.
dibbla db manages Postgres databases on the Dibbla platform. Each database is reachable from your apps via an automatically created secret, and from your laptop via the database proxy at db.dibbla.com:30432 (host derived from DIBBLA_API_URL).
dibbla db list
| Flag | Purpose |
|---|---|
-q, --quiet | Print only database names, one per line. Suitable for piping into other commands. |
$dibbla db list 🌱 Retrieving databases... Found 2 database(s): main nextjs_todo_db
# -q prints names only, one per line $dibbla db list -q | xargs -I{} dibbla db dump {}
dibbla db create
Provision a new database. Names must start with a letter, contain only a–z, 0–9 and _, and be at most 60 characters (^[a-z][a-z0-9_]{0,59}$). Uppercase input is lowercased for you rather than rejected.
| Flag | Purpose |
|---|---|
[name] (positional) | Database name. Either positional or --name is required. |
--name <name> | Alternative to the positional arg. |
--deployment <alias> | Scope the database to a specific app — the auto-generated secret is also scoped to that app. |
When you create a database, a secret is created with it:
The name is always DATABASE_URL_<UPPERCASE_NAME> — lumen_incidents becomes
DATABASE_URL_LUMEN_INCIDENTS. There is never a plain DATABASE_URL,
whatever the scope, so application code has to read the suffixed variable.
--deployment changes the secret’s scope, not its name: global to the
organisation by default, or visible only to one deployment.
$dibbla db create main 🌱 Creating database 'main'... ✅ Database 'main' created successfully Database: main Secret: DATABASE_URL_MAIN (auto-created) This is a global secret available to all deployments in your org. It will be injected automatically on every deploy.
$dibbla db create todo --deployment my-api 🌱 Creating database 'todo' (scoped to deployment 'my-api')... ✅ Database 'todo' created successfully Database: todo Secret: DATABASE_URL_TODO (auto-created) The secret is scoped to deployment 'my-api'. It will be injected automatically when that deployment starts.
dibbla db delete
Permanently delete a database. Cannot be undone.
| Flag | Purpose |
|---|---|
<name> (positional, required) | Database to delete. |
-y, --yes | Skip the confirmation prompt. |
-q, --quiet | Suppress progress and success output (errors still print to stderr). |
$dibbla db delete main --yes 🗑️ Attempting to delete database 'main'... ✅ Database 'main' deleted successfully
dibbla db dump
Download a pg_dump custom-format archive — compatible with pg_restore.
| Flag | Purpose |
|---|---|
<name> (positional, required) | Database to dump. |
-o, --output <file> | Output path. Default: <name>.dump. |
$dibbla db dump main 🌱 Dumping database 'main' to /Users/jane/projects/main.dump... ✅ Dump saved to /Users/jane/projects/main.dump $dibbla db dump main --output backup-$(date +%F).dump
# Standard pg_restore against any local Postgres $pg_restore --no-owner -d local_db main.dump
dibbla db restore
Restore a database from a dump file.
| Flag | Purpose |
|---|---|
<name> (positional, required) | Target database. Must already exist. |
-f, --file <path> (required) | Dump file to upload. |
$dibbla db restore main --file backup.dump 🌱 Restoring database 'main' from backup.dump... ✅ Database 'main' restored successfully
dibbla db connect
Print a psql-compatible connection string.
The CLI first asks the platform where the proxy is — GET /api/deploy/db/proxy-info, with a five-second timeout. If that call succeeds its answer wins, which means the host, port and TLS mode can change server-side without a CLI release. Only when it fails or times out does the CLI fall back to deriving them from DIBBLA_API_URL:
| API URL | Proxy host | sslmode |
|---|---|---|
api.dibbla.com (default) | db.dibbla.com | require |
api.dibbla.net (internal) | db.dibbla.net | disable |
localhost, 127.0.0.1 | db.dibbla.com — the fallback, not the same host | disable |
Override any of it with DIBBLA_DB_HOST, DIBBLA_DB_PORT (default 30432) or DIBBLA_DB_SSLMODE — these win over both the served answer and the fallback. Your current API token is used as the password, which is why the string must never be pasted anywhere it can be read: pass it with command substitution, psql $(dibbla db connect main -q), and never pipe it — psql reads standard input as SQL and would echo your token back inside a syntax error.
| Flag | Purpose |
|---|---|
<name> (positional, required) | Database name. |
-q, --quiet | Print only the connection string — suitable for $(...) substitution. |
$dibbla db connect main 🔗 Connection string for database 'main': postgres://dibbla:dbb_***@db.dibbla.com:30432/main?sslmode=require Quick connect: psql $(dibbla db connect main -q) Or export as an environment variable: export DATABASE_URL=$(dibbla db connect main -q)
# -q prints just the connection string, suitable for $() $psql $(dibbla db connect main -q)
$export DATABASE_URL=$(dibbla db connect main -q) $npx prisma migrate dev
db.dibbla.com:30432 presents a publicly trusted certificate
(CN=*.dibbla.com, issued by Let’s Encrypt) and the chain verifies. You do
not need sslmode=disable, and you should not use it: prefer
sslmode=require, or verify-full if your client supports it.
Check it yourself:
openssl s_client -connect db.dibbla.com:30432 -starttls postgresAn earlier version of this page described the certificate as self-signed and told you to disable verification. That was wrong — verified against the live endpoint on 2026-08-14.
The exception is internal and local endpoints: dibbla db connect emits
sslmode=disable for db.dibbla.net and for localhost, where there is no
public certificate to verify. That is a property of those environments, not
advice for yours.
See also
dibbla secrets— inspect or override the auto-createdDATABASE_URL_<NAME>.dibbla deploy— deploy an app that consumes the database via its bound secret.