@prisma/query-plan-executor 6.17.0-dev.21 → 6.17.0-dev.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +184 -81
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -53639,8 +53639,8 @@ var require_lrucache = __commonJS({
53639
53639
  const deleted = this.delete(key);
53640
53640
  if (!deleted && value !== void 0) {
53641
53641
  if (this.map.size >= this.max) {
53642
- const firstKey = this.map.keys().next().value;
53643
- this.delete(firstKey);
53642
+ const firstKey2 = this.map.keys().next().value;
53643
+ this.delete(firstKey2);
53644
53644
  }
53645
53645
  this.map.set(key, value);
53646
53646
  }
@@ -108555,7 +108555,7 @@ function isPromiseLike(value) {
108555
108555
  }
108556
108556
 
108557
108557
  // package.json
108558
- var version = "6.17.0-dev.21";
108558
+ var version = "6.17.0-dev.23";
108559
108559
 
108560
108560
  // src/utils/error.ts
108561
108561
  function extractErrorFromUnknown(value) {
@@ -109273,97 +109273,200 @@ function parseConnectionString(connectionString) {
109273
109273
  }
109274
109274
  config3.port = port;
109275
109275
  }
109276
+ const parameters = {};
109276
109277
  for (const part of paramParts) {
109277
109278
  const [key, value] = part.split("=", 2);
109278
109279
  if (!key) continue;
109279
109280
  const trimmedKey = key.trim();
109280
- const trimmedValue = value.trim();
109281
- switch (trimmedKey) {
109282
- case "database":
109283
- case "initial catalog":
109284
- config3.database = trimmedValue;
109285
- break;
109286
- case "user":
109287
- case "username":
109288
- case "uid":
109289
- case "userid":
109290
- config3.user = trimmedValue;
109291
- break;
109292
- case "password":
109293
- case "pwd":
109294
- config3.password = trimmedValue;
109295
- break;
109296
- case "encrypt":
109297
- config3.options = config3.options || {};
109298
- config3.options.encrypt = trimmedValue.toLowerCase() === "true";
109299
- break;
109300
- case "trustServerCertificate":
109301
- config3.options = config3.options || {};
109302
- config3.options.trustServerCertificate = trimmedValue.toLowerCase() === "true";
109303
- break;
109304
- case "connectionLimit": {
109305
- config3.pool = config3.pool || {};
109306
- const limit = parseInt(trimmedValue, 10);
109307
- if (isNaN(limit)) {
109308
- throw new Error(`Invalid connection limit: ${trimmedValue}`);
109309
- }
109310
- config3.pool.max = limit;
109311
- break;
109312
- }
109313
- case "connectTimeout":
109314
- case "connectionTimeout": {
109315
- const connectTimeout = parseInt(trimmedValue, 10);
109316
- if (isNaN(connectTimeout)) {
109317
- throw new Error(`Invalid connection timeout: ${trimmedValue}`);
109318
- }
109319
- config3.connectionTimeout = connectTimeout;
109320
- break;
109321
- }
109322
- case "loginTimeout": {
109323
- const loginTimeout = parseInt(trimmedValue, 10);
109324
- if (isNaN(loginTimeout)) {
109325
- throw new Error(`Invalid login timeout: ${trimmedValue}`);
109326
- }
109327
- config3.connectionTimeout = loginTimeout;
109328
- break;
109281
+ if (trimmedKey in parameters) {
109282
+ throw new Error(`Duplication configuration parameter: ${trimmedKey}`);
109283
+ }
109284
+ parameters[trimmedKey] = value.trim();
109285
+ if (!handledParameters.includes(trimmedKey)) {
109286
+ debug5(`Unknown connection string parameter: ${trimmedKey}`);
109287
+ }
109288
+ }
109289
+ const database = firstKey(parameters, "database", "initial catalog");
109290
+ if (database !== null) {
109291
+ config3.database = database;
109292
+ }
109293
+ const user = firstKey(parameters, "user", "username", "uid", "userid");
109294
+ if (user !== null) {
109295
+ config3.user = user;
109296
+ }
109297
+ const password = firstKey(parameters, "password", "pwd");
109298
+ if (password !== null) {
109299
+ config3.password = password;
109300
+ }
109301
+ const encrypt = firstKey(parameters, "encrypt");
109302
+ if (encrypt !== null) {
109303
+ config3.options = config3.options || {};
109304
+ config3.options.encrypt = encrypt.toLowerCase() === "true";
109305
+ }
109306
+ const trustServerCertificate = firstKey(parameters, "trustServerCertificate");
109307
+ if (trustServerCertificate !== null) {
109308
+ config3.options = config3.options || {};
109309
+ config3.options.trustServerCertificate = trustServerCertificate.toLowerCase() === "true";
109310
+ }
109311
+ const connectionLimit = firstKey(parameters, "connectionLimit");
109312
+ if (connectionLimit !== null) {
109313
+ config3.pool = config3.pool || {};
109314
+ const limit = parseInt(connectionLimit, 10);
109315
+ if (isNaN(limit)) {
109316
+ throw new Error(`Invalid connection limit: ${connectionLimit}`);
109317
+ }
109318
+ config3.pool.max = limit;
109319
+ }
109320
+ const connectionTimeout = firstKey(parameters, "connectionTimeout", "connectTimeout");
109321
+ if (connectionTimeout !== null) {
109322
+ const timeout = parseInt(connectionTimeout, 10);
109323
+ if (isNaN(timeout)) {
109324
+ throw new Error(`Invalid connection timeout: ${connectionTimeout}`);
109325
+ }
109326
+ config3.connectionTimeout = timeout;
109327
+ }
109328
+ const loginTimeout = firstKey(parameters, "loginTimeout");
109329
+ if (loginTimeout !== null) {
109330
+ const timeout = parseInt(loginTimeout, 10);
109331
+ if (isNaN(timeout)) {
109332
+ throw new Error(`Invalid login timeout: ${loginTimeout}`);
109333
+ }
109334
+ config3.connectionTimeout = timeout;
109335
+ }
109336
+ const socketTimeout = firstKey(parameters, "socketTimeout");
109337
+ if (socketTimeout !== null) {
109338
+ const timeout = parseInt(socketTimeout, 10);
109339
+ if (isNaN(timeout)) {
109340
+ throw new Error(`Invalid socket timeout: ${socketTimeout}`);
109341
+ }
109342
+ config3.requestTimeout = timeout;
109343
+ }
109344
+ const poolTimeout = firstKey(parameters, "poolTimeout");
109345
+ if (poolTimeout !== null) {
109346
+ const timeout = parseInt(poolTimeout, 10);
109347
+ if (isNaN(timeout)) {
109348
+ throw new Error(`Invalid pool timeout: ${poolTimeout}`);
109349
+ }
109350
+ config3.pool = config3.pool || {};
109351
+ config3.pool.acquireTimeoutMillis = timeout * 1e3;
109352
+ }
109353
+ const appName = firstKey(parameters, "applicationName", "application name");
109354
+ if (appName !== null) {
109355
+ config3.options = config3.options || {};
109356
+ config3.options.appName = appName;
109357
+ }
109358
+ const isolationLevel = firstKey(parameters, "isolationLevel");
109359
+ if (isolationLevel !== null) {
109360
+ config3.options = config3.options || {};
109361
+ config3.options.isolationLevel = mapIsolationLevelFromString(isolationLevel);
109362
+ }
109363
+ const authentication = firstKey(parameters, "authentication");
109364
+ if (authentication !== null) {
109365
+ config3.authentication = parseAuthenticationOptions(parameters, authentication);
109366
+ }
109367
+ if (!config3.server || config3.server.trim() === "") {
109368
+ throw new Error("Server host is required in connection string");
109369
+ }
109370
+ return config3;
109371
+ }
109372
+ function parseAuthenticationOptions(parameters, authenticationValue) {
109373
+ switch (authenticationValue) {
109374
+ /**
109375
+ * 'DefaultAzureCredential' is not listed in the JDBC driver spec
109376
+ * https://learn.microsoft.com/en-us/sql/connect/jdbc/setting-the-connection-properties?view=sql-server-ver15#properties
109377
+ * but is supported by tedious so included here
109378
+ */
109379
+ case "DefaultAzureCredential":
109380
+ case "ActiveDirectoryIntegrated":
109381
+ case "ActiveDirectoryInteractive":
109382
+ return { type: "azure-active-directory-default", options: {} };
109383
+ case "ActiveDirectoryPassword": {
109384
+ const userName = firstKey(parameters, "userName");
109385
+ const password = firstKey(parameters, "password");
109386
+ const clientId = firstKey(parameters, "clientId");
109387
+ const tenantId = firstKey(parameters, "tenantId");
109388
+ if (!userName || !password || !clientId) {
109389
+ throw new Error(`Invalid authentication, ActiveDirectoryPassword requires userName, password, clientId`);
109329
109390
  }
109330
- case "socketTimeout": {
109331
- const socketTimeout = parseInt(trimmedValue, 10);
109332
- if (isNaN(socketTimeout)) {
109333
- throw new Error(`Invalid socket timeout: ${trimmedValue}`);
109391
+ return {
109392
+ type: "azure-active-directory-password",
109393
+ options: {
109394
+ userName,
109395
+ password,
109396
+ clientId,
109397
+ tenantId: tenantId || ""
109334
109398
  }
109335
- config3.requestTimeout = socketTimeout;
109336
- break;
109399
+ };
109400
+ }
109401
+ case "ActiveDirectoryManagedIdentity":
109402
+ case "ActiveDirectoryMSI": {
109403
+ const clientId = firstKey(parameters, "clientId");
109404
+ const msiEndpoint = firstKey(parameters, "msiEndpoint");
109405
+ const msiSecret = firstKey(parameters, "msiSecret");
109406
+ if (!msiEndpoint || !msiSecret) {
109407
+ throw new Error(`Invalid authentication, ActiveDirectoryManagedIdentity requires msiEndpoint, msiSecret`);
109337
109408
  }
109338
- case "poolTimeout": {
109339
- const poolTimeout = parseInt(trimmedValue, 10);
109340
- if (isNaN(poolTimeout)) {
109341
- throw new Error(`Invalid pool timeout: ${trimmedValue}`);
109409
+ return {
109410
+ type: "azure-active-directory-msi-app-service",
109411
+ options: {
109412
+ clientId: clientId || void 0,
109413
+ // @ts-expect-error TODO: tedious typings don't define msiEndpoint and msiSecret -- needs to be fixed upstream
109414
+ msiEndpoint,
109415
+ msiSecret
109342
109416
  }
109343
- config3.pool = config3.pool || {};
109344
- config3.pool.acquireTimeoutMillis = poolTimeout * 1e3;
109345
- break;
109417
+ };
109418
+ }
109419
+ case "ActiveDirectoryServicePrincipal": {
109420
+ const clientId = firstKey(parameters, "userName");
109421
+ const clientSecret = firstKey(parameters, "password");
109422
+ const tenantId = firstKey(parameters, "tenantId");
109423
+ if (clientId && clientSecret) {
109424
+ return {
109425
+ type: "azure-active-directory-service-principal-secret",
109426
+ options: {
109427
+ clientId,
109428
+ clientSecret,
109429
+ tenantId: tenantId || ""
109430
+ }
109431
+ };
109432
+ } else {
109433
+ throw new Error(
109434
+ `Invalid authentication, ActiveDirectoryServicePrincipal requires userName (clientId), password (clientSecret)`
109435
+ );
109346
109436
  }
109347
- case "applicationName":
109348
- case "application name":
109349
- config3.options = config3.options || {};
109350
- config3.options.appName = trimmedValue;
109351
- break;
109352
- case "isolationLevel":
109353
- config3.options = config3.options || {};
109354
- config3.options.isolationLevel = mapIsolationLevelFromString(trimmedValue);
109355
- break;
109356
- case "schema":
109357
- break;
109358
- default:
109359
- debug5(`Unknown connection string parameter: ${trimmedKey}`);
109360
109437
  }
109361
109438
  }
109362
- if (!config3.server || config3.server.trim() === "") {
109363
- throw new Error("Server host is required in connection string");
109439
+ return void 0;
109440
+ }
109441
+ function firstKey(parameters, ...keys) {
109442
+ for (const key of keys) {
109443
+ if (key in parameters) {
109444
+ return parameters[key];
109445
+ }
109364
109446
  }
109365
- return config3;
109447
+ return null;
109366
109448
  }
109449
+ var handledParameters = [
109450
+ "application name",
109451
+ "applicationName",
109452
+ "connectTimeout",
109453
+ "connectionLimit",
109454
+ "connectionTimeout",
109455
+ "database",
109456
+ "encrypt",
109457
+ "initial catalog",
109458
+ "isolationLevel",
109459
+ "loginTimeout",
109460
+ "password",
109461
+ "poolTimeout",
109462
+ "pwd",
109463
+ "socketTimeout",
109464
+ "trustServerCertificate",
109465
+ "uid",
109466
+ "user",
109467
+ "userid",
109468
+ "username"
109469
+ ];
109367
109470
  function mapColumnType2(col) {
109368
109471
  switch (col.type) {
109369
109472
  case import_mssql3.default.VarChar:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/query-plan-executor",
3
- "version": "6.17.0-dev.21",
3
+ "version": "6.17.0-dev.23",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "temporal-polyfill": "0.3.0",
21
21
  "vitest": "3.2.4",
22
22
  "zod": "4.1.3",
23
- "@prisma/adapter-pg": "6.17.0-dev.21",
24
- "@prisma/adapter-mariadb": "6.17.0-dev.21",
25
- "@prisma/adapter-mssql": "6.17.0-dev.21",
26
- "@prisma/driver-adapter-utils": "6.17.0-dev.21",
27
- "@prisma/client-engine-runtime": "6.17.0-dev.21"
23
+ "@prisma/adapter-pg": "6.17.0-dev.23",
24
+ "@prisma/adapter-mariadb": "6.17.0-dev.23",
25
+ "@prisma/client-engine-runtime": "6.17.0-dev.23",
26
+ "@prisma/adapter-mssql": "6.17.0-dev.23",
27
+ "@prisma/driver-adapter-utils": "6.17.0-dev.23"
28
28
  },
29
29
  "files": [
30
30
  "dist"