There are two ways in: uncloud db, scoped to the app in the current directory, and the databases resource for everything else.

uncloud db add

Provision a PostgreSQL database for the linked app and print its credentials.
The database is named after the app (myapp-db), so db env can find it again later. An app must exist first — run uncloud deploy before db add.

uncloud db env

Reprint the credentials for the app’s existing database. Creates nothing.
Both commands print .env-shaped output:
A production database with a pooler also prints DATABASE_URL_READ_ONLY.
Append this to your .env rather than overwriting it, and keep it out of commits, PR descriptions, and chat. These are live credentials.

Other engines

db add provisions PostgreSQL. For MySQL, Redis, or MongoDB, create the database directly:
Then read its connection details:

Connecting an app

Databases are not exposed to the public internet — an app reaches one over the project’s internal network. Take the host from credentials and set it as environment on the app: