One Postgres cluster, many previews: Alchemy custom resources give each PR its own database

samgoodwin89 · x · 2026-10-14

A developer shows how Alchemy's custom resources let each PR preview get its own logical database on a shared PlanetScale Postgres cluster, keeping costs flat. PlanetScale clusters start at $5/month and host many logical databases with separate schemas and roles. The included TypeScript snippet reuses the staging-owned cluster for pr- stages, creates a preview-admin role, and provisions a preview database with drizzle migrations. Great for side projects, though dedicated clusters are advised at scale.

Original post →

More from coding & agent

coding & agent channel →