@prisma/config 6.12.0-dev.25 → 6.12.0-dev.27

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.
package/dist/index.d.ts CHANGED
@@ -53,7 +53,7 @@ declare const ColumnTypeEnum: {
53
53
 
54
54
  export declare type ConfigFromFile = {
55
55
  resolvedPath: string;
56
- config: PrismaConfigInternal<any>;
56
+ config: PrismaConfigInternal;
57
57
  error?: never;
58
58
  } | {
59
59
  resolvedPath: string;
@@ -61,7 +61,7 @@ export declare type ConfigFromFile = {
61
61
  error: LoadConfigFromFileError;
62
62
  } | {
63
63
  resolvedPath: null;
64
- config: PrismaConfigInternal<any>;
64
+ config: PrismaConfigInternal;
65
65
  error?: never;
66
66
  };
67
67
 
@@ -74,12 +74,12 @@ declare type ConnectionInfo = {
74
74
  /**
75
75
  * This default config can be used as basis for unit and integration tests.
76
76
  */
77
- export declare function defaultTestConfig<Env extends Record<string, string | undefined> = never>(): PrismaConfigInternal<Env>;
77
+ export declare function defaultTestConfig(): PrismaConfigInternal;
78
78
 
79
79
  /**
80
80
  * Define the configuration for the Prisma Development Kit.
81
81
  */
82
- export declare function defineConfig<Env extends Record<string, string | undefined> = never>(configInput: PrismaConfig<Env>): PrismaConfigInternal<Env>;
82
+ export declare function defineConfig(configInput: PrismaConfig): PrismaConfigInternal;
83
83
 
84
84
  /**
85
85
  * A generic driver adapter factory that allows the user to instantiate a
@@ -92,8 +92,6 @@ declare interface DriverAdapterFactory<Query, Result> extends AdapterInfo {
92
92
  connect(): Promise<Queryable<Query, Result>>;
93
93
  }
94
94
 
95
- declare type EnvVars = Record<string, string | undefined>;
96
-
97
95
  declare type Error_2 = {
98
96
  kind: 'GenericJs';
99
97
  id: number;
@@ -254,23 +252,23 @@ declare const PRISMA_CONFIG_INTERNAL_BRAND: unique symbol;
254
252
  * The configuration for the Prisma Development Kit, before it is passed to the `defineConfig` function.
255
253
  * Thanks to the branding, this type is opaque and cannot be constructed directly.
256
254
  */
257
- export declare type PrismaConfig<Env extends EnvVars = never> = {
255
+ export declare type PrismaConfig = {
258
256
  /**
259
257
  * Whether features with an unstable API are enabled.
260
258
  */
261
259
  earlyAccess: true;
262
260
  /**
263
- * The path to the schema file or path to a folder that shall be recursively searched for .prisma files.
261
+ * The path to the schema file, or path to a folder that shall be recursively searched for *.prisma files.
264
262
  */
265
263
  schema?: string;
266
264
  /**
267
- * The configuration for Prisma Studio.
265
+ * The Driver Adapter used for Prisma CLI.
268
266
  */
269
- studio?: PrismaStudioConfigShape<Env>;
267
+ adapter?: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
270
268
  /**
271
- * The configuration for Prisma Migrate + Introspect
269
+ * The configuration for Prisma Studio.
272
270
  */
273
- migrate?: PrismaMigrateConfigShape<Env>;
271
+ studio?: PrismaStudioConfigShape;
274
272
  };
275
273
 
276
274
  /**
@@ -278,11 +276,11 @@ export declare type PrismaConfig<Env extends EnvVars = never> = {
278
276
  * by the `defineConfig` function.
279
277
  * Thanks to the branding, this type is opaque and cannot be constructed directly.
280
278
  */
281
- export declare type PrismaConfigInternal<Env extends EnvVars = never> = _PrismaConfigInternal<Env> & {
279
+ export declare type PrismaConfigInternal = _PrismaConfigInternal & {
282
280
  __brand: typeof PRISMA_CONFIG_INTERNAL_BRAND;
283
281
  };
284
282
 
285
- declare type _PrismaConfigInternal<Env extends EnvVars = never> = {
283
+ declare type _PrismaConfigInternal = {
286
284
  /**
287
285
  * Whether features with an unstable API are enabled.
288
286
  */
@@ -294,11 +292,11 @@ declare type _PrismaConfigInternal<Env extends EnvVars = never> = {
294
292
  /**
295
293
  * The configuration for Prisma Studio.
296
294
  */
297
- studio?: PrismaStudioConfigShape<Env>;
295
+ studio?: PrismaStudioConfigShape;
298
296
  /**
299
- * The configuration for Prisma Migrate + Introspect
297
+ * The Driver Adapter used for Prisma CLI.
300
298
  */
301
- migrate?: PrismaMigrateConfigInternalShape<Env>;
299
+ adapter?: () => Promise<ErrorCapturingSqlMigrationAwareDriverAdapterFactory>;
302
300
  /**
303
301
  * The path from where the config was loaded.
304
302
  * It's set to `null` if no config file was found and only default config is applied.
@@ -306,16 +304,8 @@ declare type _PrismaConfigInternal<Env extends EnvVars = never> = {
306
304
  loadedFromFile: string | null;
307
305
  };
308
306
 
309
- declare type PrismaMigrateConfigInternalShape<Env extends EnvVars = never> = {
310
- adapter: (env: Env) => Promise<ErrorCapturingSqlMigrationAwareDriverAdapterFactory>;
311
- };
312
-
313
- declare type PrismaMigrateConfigShape<Env extends EnvVars = never> = {
314
- adapter: (env: Env) => Promise<SqlMigrationAwareDriverAdapterFactory>;
315
- };
316
-
317
- declare type PrismaStudioConfigShape<Env extends EnvVars = never> = {
318
- adapter: (env: Env) => Promise<SqlMigrationAwareDriverAdapterFactory>;
307
+ declare type PrismaStudioConfigShape = {
308
+ adapter: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
319
309
  };
320
310
 
321
311
  declare type Provider = 'mysql' | 'postgres' | 'sqlite' | 'sqlserver';
package/dist/index.js CHANGED
@@ -22478,8 +22478,8 @@ function defineConfig(configInput) {
22478
22478
  const config2 = defaultConfig();
22479
22479
  debug2("[default]: %o", config2);
22480
22480
  defineSchemaConfig(config2, configInput);
22481
+ defineAdapterConfig(config2, configInput);
22481
22482
  defineStudioConfig(config2, configInput);
22482
- defineMigrateConfig(config2, configInput);
22483
22483
  return config2;
22484
22484
  }
22485
22485
  function defineSchemaConfig(config2, configInput) {
@@ -22490,105 +22490,89 @@ function defineSchemaConfig(config2, configInput) {
22490
22490
  debug2("[config.schema]: %o", config2.schema);
22491
22491
  }
22492
22492
  function defineStudioConfig(config2, configInput) {
22493
- if (!configInput.studio) {
22493
+ if (!configInput.studio?.adapter) {
22494
22494
  return;
22495
22495
  }
22496
22496
  const { adapter: getAdapterFactory } = configInput.studio;
22497
22497
  config2.studio = {
22498
- adapter: async (env) => {
22499
- const adapterFactory = await getAdapterFactory(env);
22498
+ adapter: async () => {
22499
+ const adapterFactory = await getAdapterFactory();
22500
22500
  debug2("[config.studio.adapter]: %o", adapterFactory.adapterName);
22501
22501
  return adapterFactory;
22502
22502
  }
22503
22503
  };
22504
22504
  debug2("[config.studio]: %o", config2.studio);
22505
22505
  }
22506
- function defineMigrateConfig(config2, configInput) {
22507
- if (!configInput.migrate) {
22506
+ function defineAdapterConfig(config2, configInput) {
22507
+ if (!configInput.adapter) {
22508
22508
  return;
22509
22509
  }
22510
- const { adapter: getAdapterFactory } = configInput.migrate;
22511
- config2.migrate = {
22512
- adapter: async (env) => {
22513
- const adapterFactory = await getAdapterFactory(env);
22514
- debug2("[config.migrate.adapter]: %o", adapterFactory.adapterName);
22515
- return bindMigrationAwareSqlAdapterFactory(adapterFactory);
22516
- }
22510
+ const { adapter: getAdapterFactory } = configInput;
22511
+ config2.adapter = async () => {
22512
+ const adapterFactory = await getAdapterFactory();
22513
+ debug2("[config.migrate.adapter]: %o", adapterFactory.adapterName);
22514
+ return bindMigrationAwareSqlAdapterFactory(adapterFactory);
22517
22515
  };
22518
- debug2("[config.schema]: %o", config2.migrate);
22516
+ debug2("[config.adapter]: %o", config2.adapter);
22519
22517
  }
22520
22518
 
22521
22519
  // src/PrismaConfig.ts
22522
22520
  var debug3 = Debug("prisma:config:PrismaConfig");
22523
- var sqlMigrationAwareDriverAdapterFactoryShape = () => Schema_exports.declare(
22521
+ var SqlMigrationAwareDriverAdapterFactoryShape = Schema_exports.declare(
22524
22522
  (input) => {
22525
22523
  return typeof input === "function";
22526
22524
  },
22527
22525
  {
22528
- identifier: "SqlMigrationAwareDriverAdapterFactory<Env>",
22526
+ identifier: "SqlMigrationAwareDriverAdapterFactory",
22529
22527
  encode: identity,
22530
22528
  decode: identity
22531
22529
  }
22532
22530
  );
22533
- var errorCapturingSqlMigrationAwareDriverAdapterFactoryShape = () => Schema_exports.declare(
22531
+ var ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape = Schema_exports.declare(
22534
22532
  (input) => {
22535
22533
  return typeof input === "function";
22536
22534
  },
22537
22535
  {
22538
- identifier: "ErrorCapturingSqlMigrationAwareDriverAdapterFactory<Env>",
22536
+ identifier: "ErrorCapturingSqlMigrationAwareDriverAdapterFactory",
22539
22537
  encode: identity,
22540
22538
  decode: identity
22541
22539
  }
22542
22540
  );
22543
- var createPrismaStudioConfigShape = () => Schema_exports.Struct({
22541
+ var PrismaStudioConfigShape = Schema_exports.Struct({
22544
22542
  /**
22545
22543
  * Instantiates the Prisma driver adapter to use for Prisma Studio.
22546
22544
  */
22547
- adapter: sqlMigrationAwareDriverAdapterFactoryShape()
22548
- });
22549
- var createPrismaMigrateConfigShape = () => Schema_exports.Struct({
22550
- /**
22551
- * Instantiates the Prisma driver adapter to use for Prisma Migrate + Introspect.
22552
- */
22553
- adapter: sqlMigrationAwareDriverAdapterFactoryShape()
22554
- });
22555
- var createPrismaMigrateConfigInternalShape = () => Schema_exports.Struct({
22556
- /**
22557
- * Instantiates the Prisma driver adapter to use for Prisma Migrate + Introspect.
22558
- */
22559
- adapter: errorCapturingSqlMigrationAwareDriverAdapterFactoryShape()
22545
+ adapter: SqlMigrationAwareDriverAdapterFactoryShape
22560
22546
  });
22561
22547
  if (false) {
22562
22548
  __testPrismaStudioConfigShapeValueA;
22563
22549
  __testPrismaStudioConfigShapeValueB;
22564
- __testPrismaMigrateConfigShapeValueA;
22565
- __testPrismaMigrateConfigShapeValueB;
22566
22550
  }
22567
22551
  if (false) {
22568
22552
  __testPrismaConfig;
22569
22553
  __testPrismaConfigInternal;
22570
22554
  }
22571
- var createPrismaConfigShape = () => Schema_exports.Struct({
22555
+ var PrismaConfigShape = Schema_exports.Struct({
22572
22556
  earlyAccess: Schema_exports.Literal(true),
22573
22557
  schema: Schema_exports.optional(Schema_exports.String),
22574
- studio: Schema_exports.optional(createPrismaStudioConfigShape()),
22575
- migrate: Schema_exports.optional(createPrismaMigrateConfigShape())
22558
+ studio: Schema_exports.optional(PrismaStudioConfigShape),
22559
+ adapter: Schema_exports.optional(SqlMigrationAwareDriverAdapterFactoryShape)
22576
22560
  });
22577
22561
  if (false) {
22578
22562
  __testPrismaConfigValueA;
22579
22563
  __testPrismaConfigValueB;
22580
22564
  }
22581
22565
  function parsePrismaConfigShape(input) {
22582
- return Schema_exports.decodeUnknownEither(createPrismaConfigShape(), {})(input, {
22566
+ return Schema_exports.decodeUnknownEither(PrismaConfigShape, {})(input, {
22583
22567
  onExcessProperty: "error"
22584
22568
  });
22585
22569
  }
22586
22570
  var PRISMA_CONFIG_INTERNAL_BRAND = Symbol.for("PrismaConfigInternal");
22587
- var createPrismaConfigInternalShape = () => Schema_exports.Struct({
22571
+ var PrismaConfigInternalShape = Schema_exports.Struct({
22588
22572
  earlyAccess: Schema_exports.Literal(true),
22589
22573
  schema: Schema_exports.optional(Schema_exports.String),
22590
- studio: Schema_exports.optional(createPrismaStudioConfigShape()),
22591
- migrate: Schema_exports.optional(createPrismaMigrateConfigInternalShape()),
22574
+ studio: Schema_exports.optional(PrismaStudioConfigShape),
22575
+ adapter: Schema_exports.optional(ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape),
22592
22576
  loadedFromFile: Schema_exports.NullOr(Schema_exports.String)
22593
22577
  });
22594
22578
  if (false) {
@@ -22611,7 +22595,7 @@ function parsePrismaConfigInternalShape(input) {
22611
22595
  return Either_exports.right(input);
22612
22596
  }
22613
22597
  return pipe(
22614
- Schema_exports.decodeUnknownEither(createPrismaConfigInternalShape(), {})(input, {
22598
+ Schema_exports.decodeUnknownEither(PrismaConfigInternalShape, {})(input, {
22615
22599
  onExcessProperty: "error"
22616
22600
  }),
22617
22601
  // Brand the output type to make `PrismaConfigInternal` opaque, without exposing the `Effect/Brand` type
@@ -22624,7 +22608,7 @@ function parsePrismaConfigInternalShape(input) {
22624
22608
  );
22625
22609
  }
22626
22610
  function makePrismaConfigInternal(makeArgs) {
22627
- return pipe(createPrismaConfigInternalShape().make(makeArgs), brandPrismaConfigInternal);
22611
+ return pipe(PrismaConfigInternalShape.make(makeArgs), brandPrismaConfigInternal);
22628
22612
  }
22629
22613
  function parseDefaultExport(defaultExport) {
22630
22614
  const parseResultEither = pipe(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/config",
3
- "version": "6.12.0-dev.25",
3
+ "version": "6.12.0-dev.27",
4
4
  "description": "Internal package used to define and read Prisma configuration files",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,8 +21,8 @@
21
21
  "jest": "29.7.0",
22
22
  "jest-junit": "16.0.0",
23
23
  "cross-env": "7.0.3",
24
- "@prisma/driver-adapter-utils": "6.12.0-dev.25",
25
- "@prisma/get-platform": "6.12.0-dev.25"
24
+ "@prisma/driver-adapter-utils": "6.12.0-dev.27",
25
+ "@prisma/get-platform": "6.12.0-dev.27"
26
26
  },
27
27
  "files": [
28
28
  "dist"