Shipholm
Sign inStart free

Skills

App with Postgres

Its own Postgres database for apps with many concurrent writers, several replicas or SQL you already have.

When this fits

Several replicas, heavy concurrent writes, extensions (pgvector, PostGIS), or a schema from Supabase you want to keep nearly as is. Otherwise shipholm-sqlite-app is lighter: a Postgres instance runs all the time, also while the app sleeps.

Steps

  1. create_app(app=..., source_repo=..., database=true), or later update_app(database=true). The database gets 2 GiB by default (db_size). With previews=true, set database=true and the secrets on the app before the first pull request is built: a preview copies them when it is built.
  2. The app reads DATABASE_URL. The platform sets user, password and host, and the database is called app. Never put the URL in the repository or a log.
  3. Migrations at start: keep a schema_migrations table and apply the missing files in order, each in a transaction. Then a restart, a second replica and a preview all end up on the same schema.
  4. Health check: health_path="/healthz", answering 200 after SELECT 1. The app then waits for its database instead of taking traffic with a broken connection. When you move an existing app to a server that has /healthz, switch only once that server runs.
  5. previews=true gives every pull request its own empty database (at most three previews per app). Seed it at start, or import into it (below).

Data in and out

What to know

Use when: Deploy an app with its own Postgres database on Shipholm (database=true). Use when the app needs many concurrent writers, several replicas, extensions such as pgvector, or already has Postgres SQL and migrations, e.g. from Supabase.

For agents: get_skill("shipholm-postgres-app") over MCP, or the SKILL.md at https://api.shipholm.com/skills/shipholm-postgres-app/SKILL.md.