fix(prisma): resolve db config from adapters#7495
Conversation
Prisma v7 can surface db info via datasource names or adapters. Resolve the runtime datasource name and prefer adapter config, then client overrides, then runtime/env fallback so tags stay correct across pg/mariadb/mssql. Parse sqlserver:// strings with semicolon keys to recover db/user/host/port reliably. Engine spans now build a parent->children map and start at roots so nested spans are emitted without rescanning. Short-circuit tracing when there are no subscribers and ignore empty span lists to avoid unnecessary work.
Overall package sizeSelf size: 4.59 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2026-02-12 00:08:58 Comparing candidate commit 2033cff in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 228 metrics, 32 unstable metrics. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7495 +/- ##
==========================================
- Coverage 80.34% 80.28% -0.07%
==========================================
Files 731 731
Lines 31093 31152 +59
==========================================
+ Hits 24981 25009 +28
- Misses 6112 6143 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
9d12f7b to
7975158
Compare
e45e55d to
2033cff
Compare
BridgeAR
left a comment
There was a problem hiding this comment.
LGTM. Just one outcommented line should be removed
| let agent | ||
| let proc | ||
| prismaClientConfigs.forEach(config => { | ||
| // if (!config.name.includes('prisma-generator v7 mssql adapter (url)')) return |
There was a problem hiding this comment.
| // if (!config.name.includes('prisma-generator v7 mssql adapter (url)')) return |
There was a problem hiding this comment.
I will fix this as a drive-by in another PR.
| function waitForMssql () { | ||
| return new Promise((resolve, reject) => { | ||
| function waitForMssql (isSandbox) { | ||
| const tedious = isSandbox ? require('tedious') : require('../../../../../versions/tedious').get() |
There was a problem hiding this comment.
❤️ thank you for finding this!
fix(prisma): resolve db config from adapters Prisma v7 can surface db info via datasource names or adapters. Resolve the runtime datasource name and prefer adapter config, then client overrides, then runtime/env fallback so tags stay correct across pg/mariadb/mssql. Parse sqlserver:// strings with semicolon keys to recover db/user/host/port reliably. perf(prisma): use parent child relation for resolving nested spans Engine spans now build a parent->children map and start at roots so nested spans are emitted without rescanning. Short-circuit tracing when there are no subscribers and ignore empty span lists to avoid unnecessary work. test(prisma): cover v7 adapters and variants Add pg field config plus mariadb/mssql adapter fixtures so adapter parsing paths are exercised across providers. Servers toggle between connection string and field configs via env flags to hit both code paths with minimal scripts. Integration harness now selects a single import variant per config and asserts the adapter-specific db span name. Update prisma schemas to use a named datasource and the test env var to validate runtime datasource resolution. Register adapter deps in plugin externals and versions, and let varySandbox accept a binding name plus package override. test(prisma): stabilize mongodb integration Run mongo as a replica set and wait for primary readiness so Prisma's connector can attach consistently. Reset the database with the driver before each run to prevent state leakage across sandboxes. Skip migrate reset for mongo and generate unique emails to avoid duplicate key errors. test(mongo): make waitForMongo replset-aware When the configured URL requests a replica set, initialize it and wait until a primary is elected before proceeding. Keep mongodb-core for the lightweight connectivity check and use the driver only for replset setup. chore: make externals.json a js file to allow commenting Next to allowing for comments a forced entry was added which means that library will be installed as dependency. In addition, the install script now does not rewrite the package.json per dependency anymore. Instead, it gathers the entries up front and writes it once. chore(prisma): add types to the prisma instrumentation
fix(prisma): resolve db config from adapters Prisma v7 can surface db info via datasource names or adapters. Resolve the runtime datasource name and prefer adapter config, then client overrides, then runtime/env fallback so tags stay correct across pg/mariadb/mssql. Parse sqlserver:// strings with semicolon keys to recover db/user/host/port reliably. perf(prisma): use parent child relation for resolving nested spans Engine spans now build a parent->children map and start at roots so nested spans are emitted without rescanning. Short-circuit tracing when there are no subscribers and ignore empty span lists to avoid unnecessary work. test(prisma): cover v7 adapters and variants Add pg field config plus mariadb/mssql adapter fixtures so adapter parsing paths are exercised across providers. Servers toggle between connection string and field configs via env flags to hit both code paths with minimal scripts. Integration harness now selects a single import variant per config and asserts the adapter-specific db span name. Update prisma schemas to use a named datasource and the test env var to validate runtime datasource resolution. Register adapter deps in plugin externals and versions, and let varySandbox accept a binding name plus package override. test(prisma): stabilize mongodb integration Run mongo as a replica set and wait for primary readiness so Prisma's connector can attach consistently. Reset the database with the driver before each run to prevent state leakage across sandboxes. Skip migrate reset for mongo and generate unique emails to avoid duplicate key errors. test(mongo): make waitForMongo replset-aware When the configured URL requests a replica set, initialize it and wait until a primary is elected before proceeding. Keep mongodb-core for the lightweight connectivity check and use the driver only for replset setup. chore: make externals.json a js file to allow commenting Next to allowing for comments a forced entry was added which means that library will be installed as dependency. In addition, the install script now does not rewrite the package.json per dependency anymore. Instead, it gathers the entries up front and writes it once. chore(prisma): add types to the prisma instrumentation
fix(prisma): resolve db config from adapters
Prisma v7 can surface db info via datasource names or adapters.
Resolve the runtime datasource name and prefer adapter config,
then client overrides, then runtime/env fallback so tags stay
correct across pg/mariadb/mssql.
Parse sqlserver:// strings with semicolon keys to recover
db/user/host/port reliably.
perf(prisma): use parent child relation for resolving nested spans
Engine spans now build a parent->children map and start at
roots so nested spans are emitted without rescanning.
Short-circuit tracing when there are no subscribers and ignore
empty span lists to avoid unnecessary work.
test(prisma): cover v7 adapters and variants
Add pg field config plus mariadb/mssql adapter fixtures so
adapter parsing paths are exercised across providers.
Servers toggle between connection string and field configs via
env flags to hit both code paths with minimal scripts.
Integration harness now selects a single import variant per
config and asserts the adapter-specific db span name.
Update prisma schemas to use a named datasource and the test
env var to validate runtime datasource resolution.
Register adapter deps in plugin externals and versions, and
let varySandbox accept a binding name plus package override.
test(prisma): stabilize mongodb integration
Run mongo as a replica set and wait for primary readiness so
Prisma's connector can attach consistently.
Reset the database with the driver before each run to prevent
state leakage across sandboxes.
Skip migrate reset for mongo and generate unique emails to
avoid duplicate key errors.
test(mongo): make waitForMongo replset-aware
When the configured URL requests a replica set, initialize it
and wait until a primary is elected before proceeding.
Keep mongodb-core for the lightweight connectivity check and
use the driver only for replset setup.
chore: make externals.json a js file to allow commenting
Next to allowing for comments a
forcedentry was added whichmeans that library will be installed as dependency. In addition, the
install script now does not rewrite the package.json per dependency
anymore. Instead, it gathers the entries up front and writes it once.
chore(prisma): add types to the prisma instrumentation