Documentation

services

PostgreSQL

Managed PostgreSQL database with automatic provisioning and connection strings.

Add a managed PostgreSQL database to your deployment with a single line of YAML. Runix handles provisioning, networking, and connection strings automatically.

When to Use#

  • Any application that needs a relational database
  • Apps using ORMs like Prisma, SQLAlchemy, GORM, or Diesel
  • Services that need ACID transactions

Configuration#

runix.yaml
yaml
services:
  - name: db
    type: postgresql

  - name: api
    type: web-service
    repo: https://github.com/alice/api
    env:
      DATABASE_URL: "${db.connection_string}"

That is it. Runix creates a PostgreSQL container, generates credentials, and makes the connection string available to other services via variable interpolation.

Connecting from Your App#

Use the `${db.connection_string}` interpolation in your env variables. The connection string follows the standard format:

text
postgresql://user:password@hostname:5432/dbname

For a detailed guide on connecting from different languages, see the Databases > PostgreSQL page.

Backups are available on the Business plan. Automatic daily backups can be configured in the dashboard.