@prisma/client-generator-ts 7.1.0-integration-fix-fix-missing-cockroach-wasm.2 → 7.1.0

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,4 +1,4 @@
1
- import { GeneratorConfig } from '@prisma/generator';
1
+ import { ActiveConnectorType, GeneratorConfig } from '@prisma/generator';
2
2
  import { DMMFHelper } from '../dmmf';
3
3
  import { FileNameMapper } from '../file-extensions';
4
4
  import { GenericArgsInfo } from '../GenericsArgsInfo';
@@ -10,6 +10,7 @@ export interface GenerateContextOptions {
10
10
  outputFileName: FileNameMapper;
11
11
  importFileName: FileNameMapper;
12
12
  generator?: GeneratorConfig;
13
+ provider: ActiveConnectorType;
13
14
  }
14
15
  export declare class GenerateContext implements GenerateContextOptions {
15
16
  dmmf: DMMFHelper;
@@ -19,6 +20,8 @@ export declare class GenerateContext implements GenerateContextOptions {
19
20
  outputFileName: FileNameMapper;
20
21
  importFileName: FileNameMapper;
21
22
  generator?: GeneratorConfig;
22
- constructor({ dmmf, genericArgsInfo, runtimeBase, runtimeImport, outputFileName, importFileName, generator, }: GenerateContextOptions);
23
+ provider: ActiveConnectorType;
24
+ constructor({ dmmf, genericArgsInfo, runtimeBase, runtimeImport, outputFileName, importFileName, generator, provider, }: GenerateContextOptions);
23
25
  isPreviewFeatureOn(previewFeature: string): boolean;
26
+ isSqlProvider(): boolean;
24
27
  }
package/dist/index.js CHANGED
@@ -3591,7 +3591,7 @@ function queryRawDefinition(context) {
3591
3591
  * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
3592
3592
  * \`\`\`
3593
3593
  *
3594
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3594
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3595
3595
  */
3596
3596
  $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
3597
3597
 
@@ -3603,7 +3603,7 @@ function queryRawDefinition(context) {
3603
3603
  * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
3604
3604
  * \`\`\`
3605
3605
  *
3606
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3606
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3607
3607
  */
3608
3608
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`;
3609
3609
  }
@@ -3619,7 +3619,7 @@ function executeRawDefinition(context) {
3619
3619
  * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
3620
3620
  * \`\`\`
3621
3621
  *
3622
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3622
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3623
3623
  */
3624
3624
  $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
3625
3625
 
@@ -3631,7 +3631,7 @@ function executeRawDefinition(context) {
3631
3631
  * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
3632
3632
  * \`\`\`
3633
3633
  *
3634
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3634
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3635
3635
  */
3636
3636
  $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
3637
3637
  }
@@ -3676,7 +3676,7 @@ function runCommandRawDefinition(context) {
3676
3676
  })
3677
3677
  \`\`\`
3678
3678
 
3679
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3679
+ Read more in our [docs](https://pris.ly/d/raw-queries).
3680
3680
  `);
3681
3681
  return ts5.stringify(method3, { indentLevel: 1, newLine: "leading" });
3682
3682
  }
@@ -3701,7 +3701,7 @@ function getPrismaClientClassDocComment({ dmmf }) {
3701
3701
  const ${(0, import_client_common11.uncapitalize)(example.plural)} = await prisma.${(0, import_client_common11.uncapitalize)(example.model)}.findMany()
3702
3702
  \`\`\`
3703
3703
 
3704
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
3704
+ Read more in our [docs](https://pris.ly/d/client).
3705
3705
  `;
3706
3706
  }
3707
3707
  var PrismaClientClass = class {
@@ -5725,7 +5725,7 @@ function buildClientOptions(context) {
5725
5725
  { emit: 'stdout', level: 'error' }
5726
5726
  ]
5727
5727
  \`\`\`
5728
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
5728
+ Read more in our [docs](https://pris.ly/d/logging).
5729
5729
  `)
5730
5730
  );
5731
5731
  const transactionOptions = ts19.objectType().add(ts19.property("maxWait", ts19.numberType).optional()).add(ts19.property("timeout", ts19.numberType).optional());
@@ -5755,6 +5755,25 @@ function buildClientOptions(context) {
5755
5755
  \`\`\`
5756
5756
  `)
5757
5757
  );
5758
+ if (context.isSqlProvider()) {
5759
+ otherOptions.add(
5760
+ ts19.property("comments", ts19.array(ts19.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts19.docComment`
5761
+ SQL commenter plugins that add metadata to SQL queries as comments.
5762
+ Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
5763
+
5764
+ @example
5765
+ \`\`\`
5766
+ const prisma = new PrismaClient({
5767
+ adapter,
5768
+ comments: [
5769
+ traceContext(),
5770
+ queryInsights(),
5771
+ ],
5772
+ })
5773
+ \`\`\`
5774
+ `)
5775
+ );
5776
+ }
5758
5777
  const prismaClientOptions = ts19.intersectionType([mutuallyExclusiveOptions, otherOptions]);
5759
5778
  return ts19.typeDeclaration("PrismaClientOptions", prismaClientOptions);
5760
5779
  }
@@ -5768,6 +5787,7 @@ var GenerateContext = class {
5768
5787
  outputFileName;
5769
5788
  importFileName;
5770
5789
  generator;
5790
+ provider;
5771
5791
  constructor({
5772
5792
  dmmf,
5773
5793
  genericArgsInfo,
@@ -5775,7 +5795,8 @@ var GenerateContext = class {
5775
5795
  runtimeImport,
5776
5796
  outputFileName,
5777
5797
  importFileName,
5778
- generator
5798
+ generator,
5799
+ provider
5779
5800
  }) {
5780
5801
  this.dmmf = dmmf;
5781
5802
  this.genericArgsInfo = genericArgsInfo;
@@ -5784,10 +5805,14 @@ var GenerateContext = class {
5784
5805
  this.outputFileName = outputFileName;
5785
5806
  this.importFileName = importFileName;
5786
5807
  this.generator = generator;
5808
+ this.provider = provider;
5787
5809
  }
5788
5810
  isPreviewFeatureOn(previewFeature) {
5789
5811
  return this.generator?.previewFeatures?.includes(previewFeature) ?? false;
5790
5812
  }
5813
+ isSqlProvider() {
5814
+ return this.provider !== "mongodb";
5815
+ }
5791
5816
  };
5792
5817
 
5793
5818
  // src/TSClient/TSClient.ts
@@ -5807,7 +5832,8 @@ var TSClient = class {
5807
5832
  runtimeImport: `${this.options.runtimeBase}/${this.options.runtimeName}`,
5808
5833
  outputFileName: generatedFileNameMapper(this.options.generatedFileExtension),
5809
5834
  importFileName: importFileNameMapper(this.options.importFileExtension),
5810
- generator: this.options.generator
5835
+ generator: this.options.generator,
5836
+ provider: this.options.activeProvider
5811
5837
  });
5812
5838
  const modelNames = Object.values(context.dmmf.typeAndModelMap).filter((model) => context.dmmf.outputTypeMap.model[model.name]).map((model) => model.name);
5813
5839
  const modelsFileMap = modelNames.reduce((acc, modelName) => {
@@ -6380,7 +6406,7 @@ var import_internals7 = require("@prisma/internals");
6380
6406
  var import_get_tsconfig = require("get-tsconfig");
6381
6407
 
6382
6408
  // package.json
6383
- var version = "7.1.0-integration-fix-fix-missing-cockroach-wasm.2";
6409
+ var version = "7.1.0";
6384
6410
 
6385
6411
  // src/module-format.ts
6386
6412
  function parseModuleFormat(format) {
package/dist/index.mjs CHANGED
@@ -3584,7 +3584,7 @@ function queryRawDefinition(context) {
3584
3584
  * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\`
3585
3585
  * \`\`\`
3586
3586
  *
3587
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3587
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3588
3588
  */
3589
3589
  $queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
3590
3590
 
@@ -3596,7 +3596,7 @@ function queryRawDefinition(context) {
3596
3596
  * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
3597
3597
  * \`\`\`
3598
3598
  *
3599
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3599
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3600
3600
  */
3601
3601
  $queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;`;
3602
3602
  }
@@ -3612,7 +3612,7 @@ function executeRawDefinition(context) {
3612
3612
  * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\`
3613
3613
  * \`\`\`
3614
3614
  *
3615
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3615
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3616
3616
  */
3617
3617
  $executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
3618
3618
 
@@ -3624,7 +3624,7 @@ function executeRawDefinition(context) {
3624
3624
  * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
3625
3625
  * \`\`\`
3626
3626
  *
3627
- * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3627
+ * Read more in our [docs](https://pris.ly/d/raw-queries).
3628
3628
  */
3629
3629
  $executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;`;
3630
3630
  }
@@ -3669,7 +3669,7 @@ function runCommandRawDefinition(context) {
3669
3669
  })
3670
3670
  \`\`\`
3671
3671
 
3672
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access).
3672
+ Read more in our [docs](https://pris.ly/d/raw-queries).
3673
3673
  `);
3674
3674
  return ts5.stringify(method3, { indentLevel: 1, newLine: "leading" });
3675
3675
  }
@@ -3694,7 +3694,7 @@ function getPrismaClientClassDocComment({ dmmf }) {
3694
3694
  const ${uncapitalize4(example.plural)} = await prisma.${uncapitalize4(example.model)}.findMany()
3695
3695
  \`\`\`
3696
3696
 
3697
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
3697
+ Read more in our [docs](https://pris.ly/d/client).
3698
3698
  `;
3699
3699
  }
3700
3700
  var PrismaClientClass = class {
@@ -5718,7 +5718,7 @@ function buildClientOptions(context) {
5718
5718
  { emit: 'stdout', level: 'error' }
5719
5719
  ]
5720
5720
  \`\`\`
5721
- Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option).
5721
+ Read more in our [docs](https://pris.ly/d/logging).
5722
5722
  `)
5723
5723
  );
5724
5724
  const transactionOptions = ts19.objectType().add(ts19.property("maxWait", ts19.numberType).optional()).add(ts19.property("timeout", ts19.numberType).optional());
@@ -5748,6 +5748,25 @@ function buildClientOptions(context) {
5748
5748
  \`\`\`
5749
5749
  `)
5750
5750
  );
5751
+ if (context.isSqlProvider()) {
5752
+ otherOptions.add(
5753
+ ts19.property("comments", ts19.array(ts19.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts19.docComment`
5754
+ SQL commenter plugins that add metadata to SQL queries as comments.
5755
+ Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
5756
+
5757
+ @example
5758
+ \`\`\`
5759
+ const prisma = new PrismaClient({
5760
+ adapter,
5761
+ comments: [
5762
+ traceContext(),
5763
+ queryInsights(),
5764
+ ],
5765
+ })
5766
+ \`\`\`
5767
+ `)
5768
+ );
5769
+ }
5751
5770
  const prismaClientOptions = ts19.intersectionType([mutuallyExclusiveOptions, otherOptions]);
5752
5771
  return ts19.typeDeclaration("PrismaClientOptions", prismaClientOptions);
5753
5772
  }
@@ -5761,6 +5780,7 @@ var GenerateContext = class {
5761
5780
  outputFileName;
5762
5781
  importFileName;
5763
5782
  generator;
5783
+ provider;
5764
5784
  constructor({
5765
5785
  dmmf,
5766
5786
  genericArgsInfo,
@@ -5768,7 +5788,8 @@ var GenerateContext = class {
5768
5788
  runtimeImport,
5769
5789
  outputFileName,
5770
5790
  importFileName,
5771
- generator
5791
+ generator,
5792
+ provider
5772
5793
  }) {
5773
5794
  this.dmmf = dmmf;
5774
5795
  this.genericArgsInfo = genericArgsInfo;
@@ -5777,10 +5798,14 @@ var GenerateContext = class {
5777
5798
  this.outputFileName = outputFileName;
5778
5799
  this.importFileName = importFileName;
5779
5800
  this.generator = generator;
5801
+ this.provider = provider;
5780
5802
  }
5781
5803
  isPreviewFeatureOn(previewFeature) {
5782
5804
  return this.generator?.previewFeatures?.includes(previewFeature) ?? false;
5783
5805
  }
5806
+ isSqlProvider() {
5807
+ return this.provider !== "mongodb";
5808
+ }
5784
5809
  };
5785
5810
 
5786
5811
  // src/TSClient/TSClient.ts
@@ -5800,7 +5825,8 @@ var TSClient = class {
5800
5825
  runtimeImport: `${this.options.runtimeBase}/${this.options.runtimeName}`,
5801
5826
  outputFileName: generatedFileNameMapper(this.options.generatedFileExtension),
5802
5827
  importFileName: importFileNameMapper(this.options.importFileExtension),
5803
- generator: this.options.generator
5828
+ generator: this.options.generator,
5829
+ provider: this.options.activeProvider
5804
5830
  });
5805
5831
  const modelNames = Object.values(context.dmmf.typeAndModelMap).filter((model) => context.dmmf.outputTypeMap.model[model.name]).map((model) => model.name);
5806
5832
  const modelsFileMap = modelNames.reduce((acc, modelName) => {
@@ -6373,7 +6399,7 @@ import { parseEnvValue } from "@prisma/internals";
6373
6399
  import { getTsconfig } from "get-tsconfig";
6374
6400
 
6375
6401
  // package.json
6376
- var version = "7.1.0-integration-fix-fix-missing-cockroach-wasm.2";
6402
+ var version = "7.1.0";
6377
6403
 
6378
6404
  // src/module-format.ts
6379
6405
  function parseModuleFormat(format) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-generator-ts",
3
- "version": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
3
+ "version": "7.1.0",
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,7 +25,7 @@
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
  "fast-glob": "3.3.3",
30
30
  "get-tsconfig": "4.10.0",
31
31
  "indent-string": "4.0.0",
@@ -33,14 +33,14 @@
33
33
  "package-up": "5.0.0",
34
34
  "pluralize": "8.0.0",
35
35
  "ts-pattern": "5.6.2",
36
- "@prisma/client-common": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
37
- "@prisma/debug": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
38
- "@prisma/dmmf": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
39
- "@prisma/fetch-engine": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
40
- "@prisma/generator": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
41
- "@prisma/get-platform": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
42
- "@prisma/internals": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2",
43
- "@prisma/ts-builders": "7.1.0-integration-fix-fix-missing-cockroach-wasm.2"
36
+ "@prisma/client-common": "7.1.0",
37
+ "@prisma/debug": "7.1.0",
38
+ "@prisma/dmmf": "7.1.0",
39
+ "@prisma/fetch-engine": "7.1.0",
40
+ "@prisma/generator": "7.1.0",
41
+ "@prisma/get-platform": "7.1.0",
42
+ "@prisma/ts-builders": "7.1.0",
43
+ "@prisma/internals": "7.1.0"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/pluralize": "0.0.33",