@prisma/client-generator-ts 7.9.0-dev.12 → 7.9.0-dev.13

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 (3) hide show
  1. package/dist/index.js +83 -21
  2. package/dist/index.mjs +83 -21
  3. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -3693,7 +3693,7 @@ export interface PrismaClientConstructor {
3693
3693
  LogOpts extends LogOptions<Options> = LogOptions<Options>,
3694
3694
  OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
3695
3695
  ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
3696
- >(options: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
3696
+ >(options: Prisma.PrismaClientConstructorArgs<Options>): PrismaClient<LogOpts, OmitOpts, ExtArgs>
3697
3697
  }
3698
3698
 
3699
3699
  ${this.jsDoc}
@@ -5141,6 +5141,19 @@ export type Subset<T, U> = {
5141
5141
  [key in keyof T]: key extends keyof U ? T[key] : never;
5142
5142
  };
5143
5143
 
5144
+ /**
5145
+ * Resolved type of the argument passed to the \`PrismaClient\` constructor.
5146
+ *
5147
+ * When called without a narrower options type (the common case), this resolves
5148
+ * to \`PrismaClientOptions\` directly, which produces a clear TypeScript error
5149
+ * message (\`not assignable to parameter of type 'PrismaClientOptions'\`) when
5150
+ * the argument is missing or incomplete. When the user supplies a narrower
5151
+ * options type (e.g. via a literal), it falls back to \`Subset\` to keep
5152
+ * filtering out unknown properties.
5153
+ */
5154
+ export type PrismaClientConstructorArgs<Options extends PrismaClientOptions> =
5155
+ [PrismaClientOptions] extends [Options] ? PrismaClientOptions : Subset<Options, PrismaClientOptions>;
5156
+
5144
5157
  /**
5145
5158
  * SelectSubset
5146
5159
  * @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection.
@@ -5583,7 +5596,7 @@ export type BatchPayload = {
5583
5596
  ${clientExtensionsDefinitions()}
5584
5597
  export type DefaultPrismaClient = PrismaClient
5585
5598
  export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
5586
- ${ts19.stringify(ts19.moduleExport(buildClientOptions(context)))}
5599
+ ${buildClientOptions(context)}
5587
5600
  ${ts19.stringify(globalOmitConfig(context.dmmf))}
5588
5601
 
5589
5602
  /* Types for Logging */
@@ -5660,18 +5673,7 @@ function clientExtensionsDefinitions() {
5660
5673
  return ts19.stringify(define);
5661
5674
  }
5662
5675
  function buildClientOptions(context) {
5663
- const adapterOption = ts19.objectType().add(
5664
- ts19.property("adapter", ts19.namedType("runtime.SqlDriverAdapterFactory")).setDocComment(ts19.docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-pg`."))
5665
- ).add(ts19.property("accelerateUrl", ts19.neverType).optional());
5666
- const accelerateUrlOption = ts19.objectType().add(
5667
- ts19.property("accelerateUrl", ts19.stringType).setDocComment(
5668
- ts19.docComment(
5669
- "Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."
5670
- )
5671
- )
5672
- ).add(ts19.property("adapter", ts19.neverType).optional());
5673
- const mutuallyExclusiveOptions = ts19.unionType([adapterOption, accelerateUrlOption]);
5674
- const otherOptions = ts19.objectType().add(
5676
+ const baseOptions = ts19.interfaceDeclaration("PrismaClientBaseOptions").add(
5675
5677
  ts19.property("errorFormat", ts19.namedType("ErrorFormat")).optional().setDocComment(ts19.docComment('@default "colorless"'))
5676
5678
  ).add(
5677
5679
  ts19.property("log", ts19.array(ts19.unionType([ts19.namedType("LogLevel"), ts19.namedType("LogDefinition")]))).optional().setDocComment(ts19.docComment`
@@ -5703,14 +5705,14 @@ function buildClientOptions(context) {
5703
5705
  if (context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) {
5704
5706
  transactionOptions.add(ts19.property("isolationLevel", ts19.namedType("TransactionIsolationLevel")).optional());
5705
5707
  }
5706
- otherOptions.add(
5708
+ baseOptions.add(
5707
5709
  ts19.property("transactionOptions", transactionOptions).optional().setDocComment(ts19.docComment`
5708
5710
  The default values for transactionOptions
5709
5711
  maxWait ?= 2000
5710
5712
  timeout ?= 5000
5711
5713
  `)
5712
5714
  );
5713
- otherOptions.add(
5715
+ baseOptions.add(
5714
5716
  ts19.property("omit", ts19.namedType("GlobalOmitConfig")).optional().setDocComment(ts19.docComment`
5715
5717
  Global configuration for omitting model fields by default.
5716
5718
 
@@ -5727,7 +5729,7 @@ function buildClientOptions(context) {
5727
5729
  `)
5728
5730
  );
5729
5731
  if (context.isSqlProvider()) {
5730
- otherOptions.add(
5732
+ baseOptions.add(
5731
5733
  ts19.property("comments", ts19.array(ts19.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts19.docComment`
5732
5734
  SQL commenter plugins that add metadata to SQL queries as comments.
5733
5735
  Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
@@ -5745,7 +5747,7 @@ function buildClientOptions(context) {
5745
5747
  `)
5746
5748
  );
5747
5749
  }
5748
- otherOptions.add(
5750
+ baseOptions.add(
5749
5751
  ts19.property("queryPlanCacheMaxSize", ts19.numberType).optional().setDocComment(ts19.docComment`
5750
5752
  Optional maximum size for the query plan cache. If not provided, a default size will be used.
5751
5753
  A value of \`0\` can be used to disable the cache entirely. A higher cache size can improve
@@ -5761,8 +5763,68 @@ function buildClientOptions(context) {
5761
5763
  \`\`\`
5762
5764
  `)
5763
5765
  );
5764
- const prismaClientOptions = ts19.intersectionType([mutuallyExclusiveOptions, otherOptions]);
5765
- return ts19.typeDeclaration("PrismaClientOptions", prismaClientOptions);
5766
+ const withAccelerateUrl = ts19.interfaceDeclaration("PrismaClientOptionsWithAccelerateUrl").extends(ts19.namedType("PrismaClientBaseOptions")).add(
5767
+ ts19.property("accelerateUrl", ts19.stringType).setDocComment(ts19.docComment`
5768
+ The Prisma Accelerate connection URL. Use this option to connect to your database through Prisma Accelerate instead of using a driver adapter to connect directly.
5769
+
5770
+ Learn more: https://pris.ly/d/accelerate
5771
+ `)
5772
+ ).add(ts19.property("adapter", ts19.neverType).optional());
5773
+ const withAdapter = ts19.interfaceDeclaration("PrismaClientOptionsWithAdapter").extends(ts19.namedType("PrismaClientBaseOptions")).add(
5774
+ ts19.property("adapter", ts19.namedType("runtime.SqlDriverAdapterFactory")).setDocComment(ts19.docComment`
5775
+ A driver adapter that PrismaClient uses to connect to your database, such as the ones provided by \`@prisma/adapter-pg\`, \`@prisma/adapter-libsql\`, \`@prisma/adapter-planetscale\`, etc.
5776
+
5777
+ A driver adapter is **required** unless you connect to your database through Prisma Accelerate (in which case use \`accelerateUrl\` instead).
5778
+
5779
+ Learn more: https://pris.ly/d/driver-adapters
5780
+
5781
+ @example
5782
+ \`\`\`ts
5783
+ import { PrismaPg } from '@prisma/adapter-pg'
5784
+ import { PrismaClient } from './generated/prisma/client'
5785
+
5786
+ const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
5787
+ const prisma = new PrismaClient({ adapter })
5788
+ \`\`\`
5789
+ `)
5790
+ ).add(ts19.property("accelerateUrl", ts19.neverType).optional());
5791
+ const prismaClientOptionsDecl = ts19.typeDeclaration(
5792
+ "PrismaClientOptions",
5793
+ ts19.unionType([
5794
+ ts19.namedType("PrismaClientOptionsWithAccelerateUrl"),
5795
+ ts19.namedType("PrismaClientOptionsWithAdapter")
5796
+ ])
5797
+ );
5798
+ return [
5799
+ ts19.stringify(
5800
+ ts19.moduleExport(baseOptions).setDocComment(ts19.docComment`
5801
+ Options common to all variants of \`PrismaClientOptions\`, regardless of whether you connect to your database through a driver adapter or through Prisma Accelerate.
5802
+ `)
5803
+ ),
5804
+ ts19.stringify(
5805
+ ts19.moduleExport(withAccelerateUrl).setDocComment(ts19.docComment`
5806
+ \`PrismaClient\` options for connecting to your database through Prisma Accelerate instead of a driver adapter.
5807
+
5808
+ Learn more: https://pris.ly/d/accelerate
5809
+ `)
5810
+ ),
5811
+ ts19.stringify(
5812
+ ts19.moduleExport(withAdapter).setDocComment(ts19.docComment`
5813
+ \`PrismaClient\` options for connecting to your database through a driver adapter. This is the common case in Prisma 7.
5814
+
5815
+ Learn more: https://pris.ly/d/driver-adapters
5816
+ `)
5817
+ ),
5818
+ ts19.stringify(
5819
+ ts19.moduleExport(prismaClientOptionsDecl).setDocComment(ts19.docComment`
5820
+ Options passed to the \`PrismaClient\` constructor.
5821
+
5822
+ A driver adapter (or, alternatively, a Prisma Accelerate URL) is **required**. See {@link PrismaClientOptionsWithAdapter} and {@link PrismaClientOptionsWithAccelerateUrl} for the two variants. All other properties live in {@link PrismaClientBaseOptions} and are optional.
5823
+
5824
+ Learn more about driver adapters: https://pris.ly/d/driver-adapters
5825
+ `)
5826
+ )
5827
+ ].join("\n\n");
5766
5828
  }
5767
5829
 
5768
5830
  // src/TSClient/GenerateContext.ts
@@ -6398,7 +6460,7 @@ var import_internals7 = require("@prisma/internals");
6398
6460
  var import_get_tsconfig = require("get-tsconfig");
6399
6461
 
6400
6462
  // package.json
6401
- var version = "7.9.0-dev.12";
6463
+ var version = "7.9.0-dev.13";
6402
6464
 
6403
6465
  // src/module-format.ts
6404
6466
  function parseModuleFormat(format) {
package/dist/index.mjs CHANGED
@@ -3687,7 +3687,7 @@ export interface PrismaClientConstructor {
3687
3687
  LogOpts extends LogOptions<Options> = LogOptions<Options>,
3688
3688
  OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
3689
3689
  ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
3690
- >(options: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
3690
+ >(options: Prisma.PrismaClientConstructorArgs<Options>): PrismaClient<LogOpts, OmitOpts, ExtArgs>
3691
3691
  }
3692
3692
 
3693
3693
  ${this.jsDoc}
@@ -5135,6 +5135,19 @@ export type Subset<T, U> = {
5135
5135
  [key in keyof T]: key extends keyof U ? T[key] : never;
5136
5136
  };
5137
5137
 
5138
+ /**
5139
+ * Resolved type of the argument passed to the \`PrismaClient\` constructor.
5140
+ *
5141
+ * When called without a narrower options type (the common case), this resolves
5142
+ * to \`PrismaClientOptions\` directly, which produces a clear TypeScript error
5143
+ * message (\`not assignable to parameter of type 'PrismaClientOptions'\`) when
5144
+ * the argument is missing or incomplete. When the user supplies a narrower
5145
+ * options type (e.g. via a literal), it falls back to \`Subset\` to keep
5146
+ * filtering out unknown properties.
5147
+ */
5148
+ export type PrismaClientConstructorArgs<Options extends PrismaClientOptions> =
5149
+ [PrismaClientOptions] extends [Options] ? PrismaClientOptions : Subset<Options, PrismaClientOptions>;
5150
+
5138
5151
  /**
5139
5152
  * SelectSubset
5140
5153
  * @desc From \`T\` pick properties that exist in \`U\`. Simple version of Intersection.
@@ -5577,7 +5590,7 @@ export type BatchPayload = {
5577
5590
  ${clientExtensionsDefinitions()}
5578
5591
  export type DefaultPrismaClient = PrismaClient
5579
5592
  export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
5580
- ${ts19.stringify(ts19.moduleExport(buildClientOptions(context)))}
5593
+ ${buildClientOptions(context)}
5581
5594
  ${ts19.stringify(globalOmitConfig(context.dmmf))}
5582
5595
 
5583
5596
  /* Types for Logging */
@@ -5654,18 +5667,7 @@ function clientExtensionsDefinitions() {
5654
5667
  return ts19.stringify(define);
5655
5668
  }
5656
5669
  function buildClientOptions(context) {
5657
- const adapterOption = ts19.objectType().add(
5658
- ts19.property("adapter", ts19.namedType("runtime.SqlDriverAdapterFactory")).setDocComment(ts19.docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-pg`."))
5659
- ).add(ts19.property("accelerateUrl", ts19.neverType).optional());
5660
- const accelerateUrlOption = ts19.objectType().add(
5661
- ts19.property("accelerateUrl", ts19.stringType).setDocComment(
5662
- ts19.docComment(
5663
- "Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."
5664
- )
5665
- )
5666
- ).add(ts19.property("adapter", ts19.neverType).optional());
5667
- const mutuallyExclusiveOptions = ts19.unionType([adapterOption, accelerateUrlOption]);
5668
- const otherOptions = ts19.objectType().add(
5670
+ const baseOptions = ts19.interfaceDeclaration("PrismaClientBaseOptions").add(
5669
5671
  ts19.property("errorFormat", ts19.namedType("ErrorFormat")).optional().setDocComment(ts19.docComment('@default "colorless"'))
5670
5672
  ).add(
5671
5673
  ts19.property("log", ts19.array(ts19.unionType([ts19.namedType("LogLevel"), ts19.namedType("LogDefinition")]))).optional().setDocComment(ts19.docComment`
@@ -5697,14 +5699,14 @@ function buildClientOptions(context) {
5697
5699
  if (context.dmmf.hasEnumInNamespace("TransactionIsolationLevel", "prisma")) {
5698
5700
  transactionOptions.add(ts19.property("isolationLevel", ts19.namedType("TransactionIsolationLevel")).optional());
5699
5701
  }
5700
- otherOptions.add(
5702
+ baseOptions.add(
5701
5703
  ts19.property("transactionOptions", transactionOptions).optional().setDocComment(ts19.docComment`
5702
5704
  The default values for transactionOptions
5703
5705
  maxWait ?= 2000
5704
5706
  timeout ?= 5000
5705
5707
  `)
5706
5708
  );
5707
- otherOptions.add(
5709
+ baseOptions.add(
5708
5710
  ts19.property("omit", ts19.namedType("GlobalOmitConfig")).optional().setDocComment(ts19.docComment`
5709
5711
  Global configuration for omitting model fields by default.
5710
5712
 
@@ -5721,7 +5723,7 @@ function buildClientOptions(context) {
5721
5723
  `)
5722
5724
  );
5723
5725
  if (context.isSqlProvider()) {
5724
- otherOptions.add(
5726
+ baseOptions.add(
5725
5727
  ts19.property("comments", ts19.array(ts19.namedType("runtime.SqlCommenterPlugin"))).optional().setDocComment(ts19.docComment`
5726
5728
  SQL commenter plugins that add metadata to SQL queries as comments.
5727
5729
  Comments follow the sqlcommenter format: https://google.github.io/sqlcommenter/
@@ -5739,7 +5741,7 @@ function buildClientOptions(context) {
5739
5741
  `)
5740
5742
  );
5741
5743
  }
5742
- otherOptions.add(
5744
+ baseOptions.add(
5743
5745
  ts19.property("queryPlanCacheMaxSize", ts19.numberType).optional().setDocComment(ts19.docComment`
5744
5746
  Optional maximum size for the query plan cache. If not provided, a default size will be used.
5745
5747
  A value of \`0\` can be used to disable the cache entirely. A higher cache size can improve
@@ -5755,8 +5757,68 @@ function buildClientOptions(context) {
5755
5757
  \`\`\`
5756
5758
  `)
5757
5759
  );
5758
- const prismaClientOptions = ts19.intersectionType([mutuallyExclusiveOptions, otherOptions]);
5759
- return ts19.typeDeclaration("PrismaClientOptions", prismaClientOptions);
5760
+ const withAccelerateUrl = ts19.interfaceDeclaration("PrismaClientOptionsWithAccelerateUrl").extends(ts19.namedType("PrismaClientBaseOptions")).add(
5761
+ ts19.property("accelerateUrl", ts19.stringType).setDocComment(ts19.docComment`
5762
+ The Prisma Accelerate connection URL. Use this option to connect to your database through Prisma Accelerate instead of using a driver adapter to connect directly.
5763
+
5764
+ Learn more: https://pris.ly/d/accelerate
5765
+ `)
5766
+ ).add(ts19.property("adapter", ts19.neverType).optional());
5767
+ const withAdapter = ts19.interfaceDeclaration("PrismaClientOptionsWithAdapter").extends(ts19.namedType("PrismaClientBaseOptions")).add(
5768
+ ts19.property("adapter", ts19.namedType("runtime.SqlDriverAdapterFactory")).setDocComment(ts19.docComment`
5769
+ A driver adapter that PrismaClient uses to connect to your database, such as the ones provided by \`@prisma/adapter-pg\`, \`@prisma/adapter-libsql\`, \`@prisma/adapter-planetscale\`, etc.
5770
+
5771
+ A driver adapter is **required** unless you connect to your database through Prisma Accelerate (in which case use \`accelerateUrl\` instead).
5772
+
5773
+ Learn more: https://pris.ly/d/driver-adapters
5774
+
5775
+ @example
5776
+ \`\`\`ts
5777
+ import { PrismaPg } from '@prisma/adapter-pg'
5778
+ import { PrismaClient } from './generated/prisma/client'
5779
+
5780
+ const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
5781
+ const prisma = new PrismaClient({ adapter })
5782
+ \`\`\`
5783
+ `)
5784
+ ).add(ts19.property("accelerateUrl", ts19.neverType).optional());
5785
+ const prismaClientOptionsDecl = ts19.typeDeclaration(
5786
+ "PrismaClientOptions",
5787
+ ts19.unionType([
5788
+ ts19.namedType("PrismaClientOptionsWithAccelerateUrl"),
5789
+ ts19.namedType("PrismaClientOptionsWithAdapter")
5790
+ ])
5791
+ );
5792
+ return [
5793
+ ts19.stringify(
5794
+ ts19.moduleExport(baseOptions).setDocComment(ts19.docComment`
5795
+ Options common to all variants of \`PrismaClientOptions\`, regardless of whether you connect to your database through a driver adapter or through Prisma Accelerate.
5796
+ `)
5797
+ ),
5798
+ ts19.stringify(
5799
+ ts19.moduleExport(withAccelerateUrl).setDocComment(ts19.docComment`
5800
+ \`PrismaClient\` options for connecting to your database through Prisma Accelerate instead of a driver adapter.
5801
+
5802
+ Learn more: https://pris.ly/d/accelerate
5803
+ `)
5804
+ ),
5805
+ ts19.stringify(
5806
+ ts19.moduleExport(withAdapter).setDocComment(ts19.docComment`
5807
+ \`PrismaClient\` options for connecting to your database through a driver adapter. This is the common case in Prisma 7.
5808
+
5809
+ Learn more: https://pris.ly/d/driver-adapters
5810
+ `)
5811
+ ),
5812
+ ts19.stringify(
5813
+ ts19.moduleExport(prismaClientOptionsDecl).setDocComment(ts19.docComment`
5814
+ Options passed to the \`PrismaClient\` constructor.
5815
+
5816
+ A driver adapter (or, alternatively, a Prisma Accelerate URL) is **required**. See {@link PrismaClientOptionsWithAdapter} and {@link PrismaClientOptionsWithAccelerateUrl} for the two variants. All other properties live in {@link PrismaClientBaseOptions} and are optional.
5817
+
5818
+ Learn more about driver adapters: https://pris.ly/d/driver-adapters
5819
+ `)
5820
+ )
5821
+ ].join("\n\n");
5760
5822
  }
5761
5823
 
5762
5824
  // src/TSClient/GenerateContext.ts
@@ -6392,7 +6454,7 @@ import { parseEnvValue } from "@prisma/internals";
6392
6454
  import { getTsconfig } from "get-tsconfig";
6393
6455
 
6394
6456
  // package.json
6395
- var version = "7.9.0-dev.12";
6457
+ var version = "7.9.0-dev.13";
6396
6458
 
6397
6459
  // src/module-format.ts
6398
6460
  function parseModuleFormat(format) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-generator-ts",
3
- "version": "7.9.0-dev.12",
3
+ "version": "7.9.0-dev.13",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,15 +33,15 @@
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.9.0-dev.12",
37
- "@prisma/fetch-engine": "7.9.0-dev.12",
38
- "@prisma/dmmf": "7.9.0-dev.12",
39
- "@prisma/generator": "7.9.0-dev.12",
40
- "@prisma/get-platform": "7.9.0-dev.12",
41
- "@prisma/debug": "7.9.0-dev.12",
42
- "@prisma/param-graph-builder": "7.9.0-dev.12",
43
- "@prisma/internals": "7.9.0-dev.12",
44
- "@prisma/ts-builders": "7.9.0-dev.12"
36
+ "@prisma/client-common": "7.9.0-dev.13",
37
+ "@prisma/dmmf": "7.9.0-dev.13",
38
+ "@prisma/debug": "7.9.0-dev.13",
39
+ "@prisma/fetch-engine": "7.9.0-dev.13",
40
+ "@prisma/generator": "7.9.0-dev.13",
41
+ "@prisma/get-platform": "7.9.0-dev.13",
42
+ "@prisma/internals": "7.9.0-dev.13",
43
+ "@prisma/param-graph-builder": "7.9.0-dev.13",
44
+ "@prisma/ts-builders": "7.9.0-dev.13"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/pluralize": "0.0.33"