Commit 2ab8f84
feat(webapp,database): opt-in per-client Prisma driver adapters
Add per-client env vars to route each Prisma client through @prisma/adapter-pg
(node-postgres) instead of the built-in engine driver. All default off, so
behavior is unchanged unless a flag is set:
- CONTROL_PLANE_DATABASE_WRITER_DRIVER_ADAPTER
- CONTROL_PLANE_DATABASE_REPLICA_DRIVER_ADAPTER
- RUN_OPS_DATABASE_WRITER_DRIVER_ADAPTER
- RUN_OPS_DATABASE_REPLICA_DRIVER_ADAPTER
- RUN_OPS_LEGACY_DATABASE_WRITER_DRIVER_ADAPTER
- RUN_OPS_LEGACY_DATABASE_REPLICA_DRIVER_ADAPTER
Enables the driverAdapters preview feature on both schemas (keeps the Rust
query engine; does not add queryCompiler). Each adapter pool is built with a
bounded connectionTimeoutMillis and an onPoolError handler.
Handle the connect-failure differences the adapter introduces:
- isInfrastructureError now recognizes the adapter's connect-failure shapes
(P2010 'not reachable' and raw ECONNREFUSED/ENOTFOUND-class errors) so the DB
host is still scrubbed from API-client errors and infra failures are logged.
- isPrismaRetriableError treats the adapter pool-acquire timeout as retriable,
preserving the P2024 retry behavior.
refs TRI-13039
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent c526528 commit 2ab8f84
9 files changed
Lines changed: 330 additions & 159 deletions
File tree
- .server-changes
- apps/webapp
- app
- utils
- internal-packages
- database
- prisma
- src
- run-ops-database/prisma
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments