Database service

PostgreSQL

The PostgreSQL integration connects to a PostgreSQL server — shared or dedicated — and provisions a database on it, then exposes SQL queries and row-level CRUD to the rest of your project via function calls.

PostgreSQL is one of the Database service integrations. It handles its own webhook route:

POST/postgres/webhook
Connect to an existing / shared PostgreSQL server

What it does

On DEPLOYMENT_CREATED the service connects to the configured server, creates the requested database, and publishes the full connection string (including the database name) back to Dreambase as the url output. It also answers health checks, reports database metrics, and runs SQL on demand through function calls.

Attach vs. provision

The postgres route provisions a database on an existing server. To deploy a brand-new server (Docker, Neon, Render, Supabase, Railway, or DigitalOcean), use the PostgreSQL Server integration instead.

Inputs

InputRequiredDescription
serverTypeyesshared (default) uses a Dreambase-managed PostgreSQL server — no setup, ideal for MVPs and development. dedicated connects to your own server.
serverUrldedicatedPostgreSQL connection string without a database name (e.g. postgresql://user:pass@host:5432).
databaseyesName of the database to create and use.

Outputs

  • url — the PostgreSQL connection string including the database name, available to other services.

Functions

Other services can call these via a FUNCTION_CALL event:

  • query — execute a raw SQL query.
  • findRows — find rows in a table matching optional filter conditions.
  • insertRow — insert a row into a table.
  • updateRows — update rows matching filter conditions.
  • deleteRows — delete rows matching filter conditions.
  • countRows — count rows matching optional filter conditions.

Metrics

  • number_of_tables — total tables in the database.
  • number_of_rows — total rows across all tables.
  • database_size — storage used by the database.
  • active_connections — current active connections.
  • transaction_rate — transactions per second.

Events it handles

  • WEBHOOK_CHALLENGE — verify the webhook endpoint.
  • HEALTH_CHECK — confirm the database is reachable.
  • METRIC_UPDATE — report table, row, size, connection, and transaction metrics.
  • DEPLOYMENT_CREATED — provision the database and return its connection string.
  • DEPLOYMENT_DELETED — tear the database down.
  • DOWNLOAD_STARTED — signal that a build/download has begun.
  • FUNCTION_CALL — run a named SQL/row function.