Configure DigitalOcean Managed Postgres with bindable variables or schema isolation. Use when setting up databases, creating users, managing permissions, configuring multi-tenant schemas, or troubleshooting database connectivity on App Platform.
Part of the App Platform Skills router. Configures DigitalOcean Managed Postgres databases with two distinct paths based on use case.
DigitalOcean stores credentials for users created via their interface (Console, API, doctl). App Platform can automatically retrieve these credentials and populate bindable variables like ${db.DATABASE_URL}.
This means for most apps, you never need to manually manage database passwords.
| Aspect | Path A: Bindable Variables | Path B: Schema Isolation |
|--------|-------------------------------|------------------------------|
| User creation | doctl databases user create | Raw SQL (CREATE USER) |
| Password management | DO manages automatically | You manage (GitHub Secrets) |
| App spec integration | ${db.DATABASE_URL} | Manual env vars |
| Use case | Most apps | Multi-tenant SaaS |
| Permission setup | Required via doadmin | Required via doadmin |
skills/postgres/
├── SKILL.md # Main skill document (v2.1)
├── scripts/
│ ├── secure_setup.sh # 🔐 Hands-free setup (bash)
│ ├── secure_setup.py # 🔐 Hands-free setup (python)
│ ├── create_schema_user.py # Create schema + user (Path B manual)
│ ├── list_schemas_users.py # Audit schemas and permissions
│ ├── generate_connection_string.py # Generate connection strings
│ ├── add_client.py # Add tenant (multi-tenant setup)
│ ├── cleanup_client.py # Remove tenant
│ └── get_admin_conn.sh # Helper: get admin connection via doctl
└── templates/
├── orm/
│ ├── prisma.template.prisma
│ ├── sqlalchemy.template.py
│ └── drizzle.template.ts
└── migrations/
└── alembic.template.py
# 1. Create database and user via doctl
CLUSTER_ID=$(doctl databases list --format ID,Name --no-header | grep my-cluster | awk '{print $1}')
doctl databases db create $CLUSTER_ID myappdb
doctl databases user create $CLUSTER_ID myappuser
# 2. Grant permissions (REQUIRED - even with Path A!)
ADMIN_URL=$(doctl databases connection $CLUSTER_ID --format Uri --no-header)
psql "$ADMIN_URL" -c "GRANT CONNECT ON DATABASE myappdb TO myappuser;"
psql "$ADMIN_URL" -d myappdb -c "GRANT ALL ON SCHEMA public TO myappuser;"
# 3. Reference in app spec with bindable variables
# See SKILL.md for full app spec example
Option 1: Hands-Free Secure Setup (Recommended)
# Single command — password never visible, goes straight to GitHub Secrets
./scripts/secure_setup.sh \
--admin-url "$ADMIN_URL" \
--app-name myapp \
--schema myapp \
--repo owner/repo \
--env production
Option 2: Manual Setup
# Generate SQL files
python scripts/create_schema_user.py myapp myapp_user "$(openssl rand -base64 32)" \
--generate --output-dir ./sql
# Review and execute
psql "$ADMIN_URL" -f sql/db-setup.sql
psql "$ADMIN_URL" -f sql/db-users.sql
psql "$ADMIN_URL" -f sql/db-permissions.sql
# Store credentials in GitHub Secrets manually
gh secret set DATABASE_URL --repo owner/repo --body "postgresql://..."
Critical: Even with Path A, users created via doctl have NO permissions by default. You must still:
-- As doadmin
GRANT CONNECT ON DATABASE myappdb TO myappuser;
\c myappdb
GRANT ALL ON SCHEMA public TO myappuser;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO myappuser;
This skill is called when user mentions:
It integrates with:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer