StackPanel

PostgreSQL Service

Documentation for the postgres module

Project-local PostgreSQL server with automatic database creation.

Overview

Provides a mkService factory that creates a PostgreSQL instance with data stored under .stackpanel/state/services/postgres/. Handles initialization, socket-based connections, and foreground execution for process-compose.

Environment Variables

VariableExample
DATABASE_URLpostgresql://localhost:5432/myapp
POSTGRES_URLpostgresql://localhost:5432/myapp
PGHOST.stackpanel/state/services/postgres/socket
PGPORT5432
PGDATABASEmyapp
PGUSER$USER

Usage

stackpanel.globalServices.postgres = {
  enable = true;
  databases = [ "myapp" "myapp_test" ];
};

On this page