PostgreSQL for SaaS: Neon, Supabase, RDS or self-hosted
Run a ShipAny app on PostgreSQL with Drizzle ORM — connection strings for Neon, Supabase and managed Postgres, schema setup, production migrations and Cloudflare Hyperdrive.
Last updated: Oct 8, 2026
PostgreSQL is the most common production database for ShipAny apps. ShipAny talks to it through Drizzle ORM with a dedicated Postgres schema, so any provider that gives you a standard connection string works: Neon, Supabase, AWS RDS, Aliyun RDS or your own server.
What ShipAny handles
- A Postgres schema template with all built-in tables — auth, orders, subscriptions, credits, API keys, RBAC, config and content — plus strong TypeScript types for each.
- Development and production workflows:
db:pushfor fast local iteration,db:generate+db:migratefor reviewable SQL migrations in production. - Optional schema: set
DB_SCHEMAto use a schema other thanpublic. - Cloudflare Workers support through Hyperdrive, which pools connections near your database.
Setup
- Create a database and copy its connection string:
- Neon: Connect in the console —
postgresql://…neon.tech/neondb?sslmode=require - Supabase: Connect → ORMs → Drizzle — replace
[YOUR-PASSWORD]with your database password
- Neon: Connect in the console —
- Set the environment:
DATABASE_PROVIDER=postgresql
DATABASE_URL=<your-postgres-connection-string>
- Copy the Postgres schema template and create the tables:
pnpm db:setup
pnpm db:push # development
# production: pnpm db:generate && pnpm db:migrate
- Seed roles and permissions with
pnpm rbac:init.
Tips
- Never use
db:pushagainst production — generate migrations and review the SQL for destructive changes first. - Test the connection with
psqlbefore debugging the app; most problems are SSL flags or IP allowlists. - On Cloudflare Workers, connect through Hyperdrive and run migrations directly against Postgres, not through Hyperdrive.
