René's URL Explorer Experiment


Title: feat(webapp,database): opt-in per-client Prisma driver adapters by ericallam · Pull Request #4539 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: feat(webapp,database): opt-in per-client Prisma driver adapters by ericallam · Pull Request #4539 · triggerdotdev/trigger.dev

X Title: feat(webapp,database): opt-in per-client Prisma driver adapters by ericallam · Pull Request #4539 · triggerdotdev/trigger.dev

Description: What Adds an opt-in path to run each Prisma client through @prisma/adapter-pg (the node-postgres driver) instead of the built-in engine driver, controlled by a per-client env var, all off by default: env var client CONTROL_PLANE_DATABASE_WRITER_DRIVER_ADAPTER control-plane writer CONTROL_PLANE_DATABASE_REPLICA_DRIVER_ADAPTER control-plane replica RUN_OPS_DATABASE_WRITER_DRIVER_ADAPTER new run-ops writer RUN_OPS_DATABASE_REPLICA_DRIVER_ADAPTER new run-ops replica RUN_OPS_LEGACY_DATABASE_WRITER_DRIVER_ADAPTER legacy run-ops writer RUN_OPS_LEGACY_DATABASE_REPLICA_DRIVER_ADAPTER legacy run-ops replica With every flag unset the construction path is byte-identical to today (datasources URL + Rust engine), so this is inert until a flag is turned on. Per-client granularity allows enabling the adapter only where it's wanted. How Enables the driverAdapters preview feature on both schemas (@trigger.dev/database and @internal/run-ops-database). This keeps the Rust query engine — it does NOT add queryCompiler — so query behavior, result types, and engine tracing spans are unchanged. A shared buildDriverAdapterPool builds each client's pg.Pool with an explicit max, a bounded connectionTimeoutMillis (the node-postgres pool otherwise waits unbounded on acquire), and an onPoolError handler (an unhandled idle-connection error would otherwise crash the process). Threaded through all four client builders via a useDriverAdapter flag. Adds @prisma/adapter-pg + @types/pg to the webapp; pg is already pinned at 8.15.6 (adapter-pg 6.x requires pg < 8.17). Connect-failure handling (the important correctness/security bit) Under the adapter an unreachable DB no longer surfaces as PrismaClientInitializationError / P1001; it becomes a P2010 "Database not reachable: " (or a raw ECONNREFUSED/ENOTFOUND-class error). Two handlers are updated so a client on the adapter behaves like today: isInfrastructureError now recognizes those shapes (P2010 with a connectivity message, and raw connectivity errno codes). Without this, the DB hostname would leak into API-client-facing errors and the failure would go unlogged. Security-relevant. isPrismaRetriableError treats the adapter's pool-acquire timeout ("timeout exceeded when trying to connect") as retriable, preserving the P2024 retry behavior the adapter otherwise drops. Evidence Validated on an isolated stack that mirrors the production DB topology (chained PgBouncers in front of writer + reader): Behavioral parity: raw-query results and Prisma error codes/meta are byte-identical between the engine driver and the adapter across the queried shapes (unique-constraint meta.target, record-not-found, transaction-timeout, serialization-failure, etc.). Feature matrix: a full 380-project queue-ay pass shows no adapter-caused regressions — pass/fail parity between adapter-off and adapter-on, with the residual failures being pre-existing known-failures/flakes common to both. Rollout / rollback All flags default off; enable per client via env var, roll back by unsetting and redeploying (no data migration). Recommended first target is a single writer; enable one client at a time. Follow-ups (not in this PR) $metrics-based pool observability is removed under the adapter (the Prometheus route + db.pool.connections.* instruments); the metrics replacement (via pg.Pool counters) lands in a separate PR. Note for operators: on the adapter path, interactive-transaction maxWait does not bound pool acquisition — connectionTimeoutMillis does. Note on connection-string parameters The adapter pool is built from the base DSN, so Prisma-specific DSN parameters that node-postgres does not understand are not honored when a client is on the adapter: Prisma TLS spellings (sslaccept, sslcert, etc.) — node-postgres uses sslmode/ssl instead. Our production DSNs do not use these Prisma-specific TLS params, but any deployment whose DSN relies on them must be checked before enabling a flag. pgbouncer=true and statement_cache_size — effectively moot under the adapter, which uses no persistent named prepared statements. connection_limit, pool_timeout, and schema are handled explicitly (passed as max/connectionTimeoutMillis and PrismaPg's {schema} option). refs TRI-13039

Open Graph Description: What Adds an opt-in path to run each Prisma client through @prisma/adapter-pg (the node-postgres driver) instead of the built-in engine driver, controlled by a per-client env var, all off by defaul...

X Description: What Adds an opt-in path to run each Prisma client through @prisma/adapter-pg (the node-postgres driver) instead of the built-in engine driver, controlled by a per-client env var, all off by defaul...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4539

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:879fb25a-afd5-af88-57ef-3f4bb3ca632c
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBD70:3AAE13:310757C:45ACD91:6AFAF178
html-safe-nonce5624100e843678855e25a03b4aac133deb80fed5bfb69dfbd076c8ff8acb99c1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRDcwOjNBQUUxMzozMTA3NTdDOjQ1QUNEOTE6NkFGQUYxNzgiLCJ2aXNpdG9yX2lkIjoiNDAxMTk1MjIxMDIzNjMzODU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacb6064acce67a6b684a2e8700d09491ce74c1bce7e64890908a08a64559e72782
hovercard-subject-tagpull_request:4234723290
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4539/files
twitter:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/534?s=400&v=4
og:image:altWhat Adds an opt-in path to run each Prisma client through @prisma/adapter-pg (the node-postgres driver) instead of the built-in engine driver, controlled by a per-client env var, all off by defaul...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4539/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4539%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4539%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
ericallamhttps://github.com/ericallam
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
feat/prisma-adapter-pg-per-client-toggleshttps://github.com/triggerdotdev/trigger.dev/tree/feat/prisma-adapter-pg-per-client-toggles
Conversation 42 https://github.com/triggerdotdev/trigger.dev/pull/4539
Commits 5 https://github.com/triggerdotdev/trigger.dev/pull/4539/commits
Checks 76 https://github.com/triggerdotdev/trigger.dev/pull/4539/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4539/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
feat(webapp,database): opt-in per-client Prisma driver adapters https://github.com/triggerdotdev/trigger.dev/pull/4539/files#top
Show all changes 5 commits https://github.com/triggerdotdev/trigger.dev/pull/4539/files
2ab8f84 feat(webapp,database): opt-in per-client Prisma driver adapters ericallam Aug 8, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4539/commits/2ab8f845fb3c1e9e7a5a5ba4159d4dc6be8be91e
f07ac7c fix(webapp): address review on driver-adapter pools ericallam Aug 8, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4539/commits/f07ac7c9e9ab366a0cf3c483306529780db6d4c5
1c72e57 fix(webapp,database): address Devin review on the driver-adapter path ericallam Aug 8, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4539/commits/1c72e5777d37d71a96f359e345e2e66feda24fc0
24286a0 fix(database): retry adapter pool-acquire timeouts in $transaction ericallam Aug 8, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4539/commits/24286a0c2213580dbf2f34baf44c719d463052b7
afbd62b fix(webapp): retry driver-adapter connectivity errors in the mollifie… ericallam Aug 8, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4539/commits/afbd62b7b4f1a6c9c456de052e1cf2b28f05d221
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4539/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
prisma-driver-adapter-per-client.md https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-0e9f22b61b843e2f6df40e4352d182f57cdc74a9246d68682c1ce05381b10c22
db.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-f81e28167ca153a26ec3513924ea843f71b59992d6fddf7f66ebe131bd5b0d89
env.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-f8823615ef72da3494e74de9e62b2fa31315ed9360f17bc06ab943f4dc25f4fd
metrics.ts https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-e24cf5a28474e71ebac052f3843d306ca4c64375f521c53f12ce1cf860c25760
prismaErrors.ts https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-30825802457ab1f02291774b8444f55875c1935b87624dbe5348c09c56771d82
mollifierDrainerHandler.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-4086d5cd417f4dbd62c65a666fd56f8c2513f581d0fe5728c3b4b09239a36766
tracer.server.ts https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-746e75ef48528afe08bbadc078c7c25e75fdc178a0f706b614860816c4ea5eaf
package.json https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-7f07c1a8c7d8bf8a62c48e4913ae22619918c9d72fc3b12aa75aa5c03217612b
schema.prisma https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-6b8eefc1da429865c9493bbac9d2c4d00d1cfe2f2231f6474b9692f13b88e419
transaction.ts https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-525f244c3933002a55d7eb96bf04fd7592b3e1e9ce6c7a2c7f10366980d0fe63
schema.prisma https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-1d971cc50c6329cf20d05d734fdfd6ecdbf3562d51c49243197274334b912317
pnpm-lock.yaml https://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bb
.server-changes/prisma-driver-adapter-per-client.mdhttps://github.com/triggerdotdev/trigger.dev/pull/4539/files#diff-0e9f22b61b843e2f6df40e4352d182f57cdc74a9246d68682c1ce05381b10c22
View file https://github.com/triggerdotdev/trigger.dev/blob/afbd62b7b4f1a6c9c456de052e1cf2b28f05d221/.server-changes/prisma-driver-adapter-per-client.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4539/{{ revealButtonHref }}
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4539/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.