@prisma/client-generator-js 7.1.0-integration-fix-fix-missing-cockroach-wasm.2 → 7.2.0-dev.1

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.
@@ -1,15 +1,18 @@
1
- import { GeneratorConfig } from '@prisma/generator';
1
+ import { ActiveConnectorType, GeneratorConfig } from '@prisma/generator';
2
2
  import { DMMFHelper } from '../dmmf';
3
3
  import { GenericArgsInfo } from '../GenericsArgsInfo';
4
4
  export interface GenerateContextOptions {
5
5
  dmmf: DMMFHelper;
6
6
  genericArgsInfo: GenericArgsInfo;
7
7
  generator?: GeneratorConfig;
8
+ provider: ActiveConnectorType;
8
9
  }
9
10
  export declare class GenerateContext implements GenerateContextOptions {
10
11
  dmmf: DMMFHelper;
11
12
  genericArgsInfo: GenericArgsInfo;
12
13
  generator?: GeneratorConfig;
13
- constructor({ dmmf, genericArgsInfo, generator }: GenerateContextOptions);
14
+ provider: ActiveConnectorType;
15
+ constructor({ dmmf, genericArgsInfo, generator, provider }: GenerateContextOptions);
14
16
  isPreviewFeatureOn(previewFeature: string): boolean;
17
+ isSqlProvider(): boolean;
15
18
  }
package/dist/index.js CHANGED
@@ -2483,16 +2483,20 @@ var package_default = {
2483
2483
  "@prisma/dmmf": "workspace:*",
2484
2484
  "@prisma/driver-adapter-utils": "workspace:*",
2485
2485
  "@prisma/engines": "workspace:*",
2486
- "@prisma/engines-version": "7.1.0-2.f09f2815f091dbba658cdcd2264306d88bb5bda6",
2486
+ "@prisma/engines-version": "7.1.0-6.ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
2487
2487
  "@prisma/fetch-engine": "workspace:*",
2488
2488
  "@prisma/generator": "workspace:*",
2489
2489
  "@prisma/generator-helper": "workspace:*",
2490
2490
  "@prisma/get-platform": "workspace:*",
2491
2491
  "@prisma/instrumentation": "workspace:*",
2492
+ "@prisma/instrumentation-contract": "workspace:*",
2492
2493
  "@prisma/internals": "workspace:*",
2494
+ "@prisma/json-protocol": "workspace:*",
2493
2495
  "@prisma/migrate": "workspace:*",
2494
- "@prisma/query-compiler-wasm": "7.1.0-2.f09f2815f091dbba658cdcd2264306d88bb5bda6",
2496
+ "@prisma/query-compiler-wasm": "7.1.0-6.ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
2495
2497
  "@prisma/query-plan-executor": "workspace:*",
2498
+ "@prisma/sqlcommenter": "workspace:*",
2499
+ "@prisma/sqlcommenter-trace-context": "workspace:*",
2496
2500
  "@prisma/ts-builders": "workspace:*",
2497
2501
  "@snaplet/copycat": "6.0.0",
2498
2502
  "@swc-node/register": "1.10.9",
@@ -5232,14 +5236,19 @@ var GenerateContext = class {
5232
5236
  dmmf;
5233
5237
  genericArgsInfo;
5234
5238
  generator;
5235
- constructor({ dmmf, genericArgsInfo, generator }) {
5239
+ provider;
5240
+ constructor({ dmmf, genericArgsInfo, generator, provider }) {
5236
5241
  this.dmmf = dmmf;
5237
5242
  this.genericArgsInfo = genericArgsInfo;
5238
5243
  this.generator = generator;
5244
+ this.provider = provider;
5239
5245
  }
5240
5246
  isPreviewFeatureOn(previewFeature) {
5241
5247
  return this.generator?.previewFeatures?.includes(previewFeature) ?? false;
5242
5248
  }
5249
+ isSqlProvider() {
5250
+ return this.provider !== "mongodb";
5251
+ }
5243
5252
  };
5244
5253
 
5245
5254
  // src/TSClient/PrismaClient.ts
@@ -5434,7 +5443,7 @@ function queryRawDefinition(context) {
5434
5443
  * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
5435
5444
  * \`\`\`
5436
5445
  *
5437
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5446
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5438
5447
  */
5439
5448
  $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
5440
5449
 
@@ -5446,7 +5455,7 @@ function queryRawDefinition(context) {
5446
5455
  * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
5447
5456
  * \`\`\`
5448
5457
  *
5449
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5458
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5450
5459
  */
5451
5460
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`;
5452
5461
  }
@@ -5462,7 +5471,7 @@ function executeRawDefinition(context) {
5462
5471
  * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
5463
5472
  * \`\`\`
5464
5473
  *
5465
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5474
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5466
5475
  */
5467
5476
  $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
5468
5477
 
@@ -5474,7 +5483,7 @@ function executeRawDefinition(context) {
5474
5483
  * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
5475
5484
  * \`\`\`
5476
5485
  *
5477
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5486
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5478
5487
  */
5479
5488
  $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
5480
5489
  }
@@ -5519,7 +5528,7 @@ function runCommandRawDefinition(context) {
5519
5528
  })
5520
5529
  \`\`\`
5521
5530
 
5522
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5531
+ Read more in our [docs](https://pris.ly/d/raw-queries).
5523
5532
  `);
5524
5533
  return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
5525
5534
  }
@@ -5554,7 +5563,7 @@ var PrismaClientClass = class {
5554
5563
  * \`\`\`
5555
5564
  *
5556
5565
  *
5557
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
5566
+ * Read more in our [docs](https://pris.ly/d/client).
5558
5567
  */`;
5559
5568
  }
5560
5569
  toTSWithoutNamespace() {
@@ -5712,7 +5721,7 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5712
5721
  { emit: 'stdout', level: 'error' }
5713
5722
  ]
5714
5723
  \`\`\`
5715
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
5724
+ Read more in our [docs](https://pris.ly/d/logging).
5716
5725
  `)
5717
5726
  );
5718
5727
  const transactionOptions = ts11.objectType().add(ts11.property("maxWait", ts11.numberType).optional()).add(ts11.property("timeout", ts11.numberType).optional());
@@ -5759,6 +5768,25 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5759
5768
  \`\`\`
5760
5769
  `)
5761
5770
  );
5771
+ if (this.context.isSqlProvider()) {
5772
+ clientOptions.add(
5773
+ ts11.property("comments", ts11.array(ts11.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts11.docComment`
5774
+ SQL commenter plugins that add metadata to SQL queries as comments.
5775
+ Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
5776
+
5777
+ @example
5778
+ \`\`\`
5779
+ const prisma = new PrismaClient({
5780
+ adapter,
5781
+ comments: [
5782
+ traceContext(),
5783
+ queryInsights(),
5784
+ ],
5785
+ })
5786
+ \`\`\`
5787
+ `)
5788
+ );
5789
+ }
5762
5790
  return clientOptions;
5763
5791
  }
5764
5792
  };
@@ -5825,7 +5853,8 @@ Object.assign(exports, Prisma)
5825
5853
  const context = new GenerateContext({
5826
5854
  dmmf: this.dmmf,
5827
5855
  genericArgsInfo: this.genericsInfo,
5828
- generator: this.options.generator
5856
+ generator: this.options.generator,
5857
+ provider: this.options.activeProvider
5829
5858
  });
5830
5859
  const prismaClientClass = new PrismaClientClass(
5831
5860
  context,
@@ -6570,7 +6599,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
6570
6599
  }
6571
6600
  const schemaTargetPath = import_path.default.join(outputDir, "schema.prisma");
6572
6601
  await import_promises.default.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" });
6573
- if (isWasmEngineSupported(provider) && !testMode) {
6602
+ if (isWasmEngineSupported(provider)) {
6574
6603
  const suffix = provider === "postgres" ? "postgresql" : provider;
6575
6604
  const filename = "query_compiler_bg";
6576
6605
  const wasmJsBundlePath = import_path.default.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
@@ -6787,7 +6816,7 @@ var import_engines_version = require("@prisma/engines-version");
6787
6816
  var import_internals9 = require("@prisma/internals");
6788
6817
 
6789
6818
  // package.json
6790
- var version = "7.1.0-integration-fix-fix-missing-cockroach-wasm.2";
6819
+ var version = "7.2.0-dev.1";
6791
6820
 
6792
6821
  // src/resolvePrismaClient.ts
6793
6822
  var import_promises2 = __toESM(require("node:fs/promises"));
package/dist/index.mjs CHANGED
@@ -2472,16 +2472,20 @@ var package_default = {
2472
2472
  "@prisma/dmmf": "workspace:*",
2473
2473
  "@prisma/driver-adapter-utils": "workspace:*",
2474
2474
  "@prisma/engines": "workspace:*",
2475
- "@prisma/engines-version": "7.1.0-2.f09f2815f091dbba658cdcd2264306d88bb5bda6",
2475
+ "@prisma/engines-version": "7.1.0-6.ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
2476
2476
  "@prisma/fetch-engine": "workspace:*",
2477
2477
  "@prisma/generator": "workspace:*",
2478
2478
  "@prisma/generator-helper": "workspace:*",
2479
2479
  "@prisma/get-platform": "workspace:*",
2480
2480
  "@prisma/instrumentation": "workspace:*",
2481
+ "@prisma/instrumentation-contract": "workspace:*",
2481
2482
  "@prisma/internals": "workspace:*",
2483
+ "@prisma/json-protocol": "workspace:*",
2482
2484
  "@prisma/migrate": "workspace:*",
2483
- "@prisma/query-compiler-wasm": "7.1.0-2.f09f2815f091dbba658cdcd2264306d88bb5bda6",
2485
+ "@prisma/query-compiler-wasm": "7.1.0-6.ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
2484
2486
  "@prisma/query-plan-executor": "workspace:*",
2487
+ "@prisma/sqlcommenter": "workspace:*",
2488
+ "@prisma/sqlcommenter-trace-context": "workspace:*",
2485
2489
  "@prisma/ts-builders": "workspace:*",
2486
2490
  "@snaplet/copycat": "6.0.0",
2487
2491
  "@swc-node/register": "1.10.9",
@@ -5224,14 +5228,19 @@ var GenerateContext = class {
5224
5228
  dmmf;
5225
5229
  genericArgsInfo;
5226
5230
  generator;
5227
- constructor({ dmmf, genericArgsInfo, generator }) {
5231
+ provider;
5232
+ constructor({ dmmf, genericArgsInfo, generator, provider }) {
5228
5233
  this.dmmf = dmmf;
5229
5234
  this.genericArgsInfo = genericArgsInfo;
5230
5235
  this.generator = generator;
5236
+ this.provider = provider;
5231
5237
  }
5232
5238
  isPreviewFeatureOn(previewFeature) {
5233
5239
  return this.generator?.previewFeatures?.includes(previewFeature) ?? false;
5234
5240
  }
5241
+ isSqlProvider() {
5242
+ return this.provider !== "mongodb";
5243
+ }
5235
5244
  };
5236
5245
 
5237
5246
  // src/TSClient/PrismaClient.ts
@@ -5426,7 +5435,7 @@ function queryRawDefinition(context) {
5426
5435
  * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
5427
5436
  * \`\`\`
5428
5437
  *
5429
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5438
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5430
5439
  */
5431
5440
  $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
5432
5441
 
@@ -5438,7 +5447,7 @@ function queryRawDefinition(context) {
5438
5447
  * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
5439
5448
  * \`\`\`
5440
5449
  *
5441
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5450
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5442
5451
  */
5443
5452
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`;
5444
5453
  }
@@ -5454,7 +5463,7 @@ function executeRawDefinition(context) {
5454
5463
  * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
5455
5464
  * \`\`\`
5456
5465
  *
5457
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5466
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5458
5467
  */
5459
5468
  $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
5460
5469
 
@@ -5466,7 +5475,7 @@ function executeRawDefinition(context) {
5466
5475
  * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
5467
5476
  * \`\`\`
5468
5477
  *
5469
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5478
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
5470
5479
  */
5471
5480
  $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
5472
5481
  }
@@ -5511,7 +5520,7 @@ function runCommandRawDefinition(context) {
5511
5520
  })
5512
5521
  \`\`\`
5513
5522
 
5514
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
5523
+ Read more in our [docs](https://pris.ly/d/raw-queries).
5515
5524
  `);
5516
5525
  return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
5517
5526
  }
@@ -5546,7 +5555,7 @@ var PrismaClientClass = class {
5546
5555
  * \`\`\`
5547
5556
  *
5548
5557
  *
5549
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
5558
+ * Read more in our [docs](https://pris.ly/d/client).
5550
5559
  */`;
5551
5560
  }
5552
5561
  toTSWithoutNamespace() {
@@ -5704,7 +5713,7 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5704
5713
  { emit: 'stdout', level: 'error' }
5705
5714
  ]
5706
5715
  \`\`\`
5707
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
5716
+ Read more in our [docs](https://pris.ly/d/logging).
5708
5717
  `)
5709
5718
  );
5710
5719
  const transactionOptions = ts11.objectType().add(ts11.property("maxWait", ts11.numberType).optional()).add(ts11.property("timeout", ts11.numberType).optional());
@@ -5751,6 +5760,25 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
5751
5760
  \`\`\`
5752
5761
  `)
5753
5762
  );
5763
+ if (this.context.isSqlProvider()) {
5764
+ clientOptions.add(
5765
+ ts11.property("comments", ts11.array(ts11.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts11.docComment`
5766
+ SQL commenter plugins that add metadata to SQL queries as comments.
5767
+ Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
5768
+
5769
+ @example
5770
+ \`\`\`
5771
+ const prisma = new PrismaClient({
5772
+ adapter,
5773
+ comments: [
5774
+ traceContext(),
5775
+ queryInsights(),
5776
+ ],
5777
+ })
5778
+ \`\`\`
5779
+ `)
5780
+ );
5781
+ }
5754
5782
  return clientOptions;
5755
5783
  }
5756
5784
  };
@@ -5817,7 +5845,8 @@ Object.assign(exports, Prisma)
5817
5845
  const context = new GenerateContext({
5818
5846
  dmmf: this.dmmf,
5819
5847
  genericArgsInfo: this.genericsInfo,
5820
- generator: this.options.generator
5848
+ generator: this.options.generator,
5849
+ provider: this.options.activeProvider
5821
5850
  });
5822
5851
  const prismaClientClass = new PrismaClientClass(
5823
5852
  context,
@@ -6562,7 +6591,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
6562
6591
  }
6563
6592
  const schemaTargetPath = path.join(outputDir, "schema.prisma");
6564
6593
  await fs.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" });
6565
- if (isWasmEngineSupported(provider) && !testMode) {
6594
+ if (isWasmEngineSupported(provider)) {
6566
6595
  const suffix = provider === "postgres" ? "postgresql" : provider;
6567
6596
  const filename = "query_compiler_bg";
6568
6597
  const wasmJsBundlePath = path.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
@@ -6779,7 +6808,7 @@ import { enginesVersion } from "@prisma/engines-version";
6779
6808
  import { parseEnvValue } from "@prisma/internals";
6780
6809
 
6781
6810
  // package.json
6782
- var version = "7.1.0-integration-fix-fix-missing-cockroach-wasm.2";
6811
+ var version = "7.2.0-dev.1";
6783
6812
 
6784
6813
  // src/resolvePrismaClient.ts
6785
6814
  import fs2 from "node:fs/promises";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-generator-js",
3
- "version": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
3
+ "version": "7.2.0-dev.1",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -25,21 +25,21 @@
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
27
  "@antfu/ni": "0.21.12",
28
- "@prisma/engines-version": "7.1.0-2.f09f2815f091dbba658cdcd2264306d88bb5bda6",
28
+ "@prisma/engines-version": "7.1.0-6.ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
29
29
  "env-paths": "2.2.1",
30
30
  "indent-string": "4.0.0",
31
31
  "klona": "2.0.6",
32
32
  "package-up": "5.0.0",
33
33
  "pluralize": "8.0.0",
34
34
  "ts-pattern": "5.6.2",
35
- "@prisma/debug": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
36
- "@prisma/client-common": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
37
- "@prisma/dmmf": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
38
- "@prisma/fetch-engine": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
39
- "@prisma/generator": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
40
- "@prisma/get-platform": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
41
- "@prisma/internals": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
42
- "@prisma/ts-builders": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2"
35
+ "@prisma/dmmf": "7.2.0-dev.1",
36
+ "@prisma/debug": "7.2.0-dev.1",
37
+ "@prisma/client-common": "7.2.0-dev.1",
38
+ "@prisma/fetch-engine": "7.2.0-dev.1",
39
+ "@prisma/generator": "7.2.0-dev.1",
40
+ "@prisma/get-platform": "7.2.0-dev.1",
41
+ "@prisma/internals": "7.2.0-dev.1",
42
+ "@prisma/ts-builders": "7.2.0-dev.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/pluralize": "0.0.33",