Skip to Content
DevelopersDecision records0002 pg driver adapter

0002: Use the pg driver adapter for Prisma

Status: accepted

Context

Prisma 7 requires a driver adapter. v1 used @prisma/adapter-neon, which talks to Neon over WebSockets. That suits serverless functions, but the v2 API is a long-lived server with queue workers, and the local development database is plain PostgreSQL in Docker, which the Neon adapter cannot reach.

Decision

Use @prisma/adapter-pg with a standard connection pool. It works against Neon over TCP and against local PostgreSQL, so development and production use the same code path.

Consequences

  • Local development with docker compose just works.
  • Workers and the API share one adapter and one pooling model.
  • If the API is ever moved to a serverless runtime, revisit this decision.
Last updated on