@prisma/config 7.3.0-integration-prisma6-fix-cloudflare-engine.2 → 7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +25 -451
  2. package/dist/index.js +79 -383
  3. package/package.json +4 -3
package/dist/index.d.ts CHANGED
@@ -1,61 +1,3 @@
1
- import { Schema } from 'effect';
2
-
3
- /**
4
- * An interface that exposes some basic information about the
5
- * adapter like its name and provider type.
6
- */
7
- declare interface AdapterInfo {
8
- readonly provider: Provider;
9
- readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {});
10
- }
11
-
12
- declare type ArgScalarType = 'string' | 'int' | 'bigint' | 'float' | 'decimal' | 'boolean' | 'enum' | 'uuid' | 'json' | 'datetime' | 'bytes' | 'unknown';
13
-
14
- declare type ArgType = {
15
- scalarType: ArgScalarType;
16
- dbType?: string;
17
- arity: Arity;
18
- };
19
-
20
- declare type Arity = 'scalar' | 'list';
21
-
22
- declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum];
23
-
24
- declare const ColumnTypeEnum: {
25
- readonly Int32: 0;
26
- readonly Int64: 1;
27
- readonly Float: 2;
28
- readonly Double: 3;
29
- readonly Numeric: 4;
30
- readonly Boolean: 5;
31
- readonly Character: 6;
32
- readonly Text: 7;
33
- readonly Date: 8;
34
- readonly Time: 9;
35
- readonly DateTime: 10;
36
- readonly Json: 11;
37
- readonly Enum: 12;
38
- readonly Bytes: 13;
39
- readonly Set: 14;
40
- readonly Uuid: 15;
41
- readonly Int32Array: 64;
42
- readonly Int64Array: 65;
43
- readonly FloatArray: 66;
44
- readonly DoubleArray: 67;
45
- readonly NumericArray: 68;
46
- readonly BooleanArray: 69;
47
- readonly CharacterArray: 70;
48
- readonly TextArray: 71;
49
- readonly DateArray: 72;
50
- readonly TimeArray: 73;
51
- readonly DateTimeArray: 74;
52
- readonly JsonArray: 75;
53
- readonly EnumArray: 76;
54
- readonly BytesArray: 77;
55
- readonly UuidArray: 78;
56
- readonly UnknownNumber: 128;
57
- };
58
-
59
1
  export declare type ConfigDiagnostic = {
60
2
  _tag: 'log';
61
3
  value: (formatters: InjectFormatters) => () => void;
@@ -81,10 +23,9 @@ export declare type ConfigFromFile = {
81
23
  diagnostics: ConfigDiagnostic[];
82
24
  };
83
25
 
84
- declare type ConnectionInfo = {
85
- schemaName?: string;
86
- maxBindValues?: number;
87
- supportsRelationJoins: boolean;
26
+ export declare type Datasource = {
27
+ url?: string;
28
+ shadowDatabaseUrl?: string;
88
29
  };
89
30
 
90
31
  /**
@@ -97,17 +38,6 @@ export declare function defaultTestConfig(): PrismaConfigInternal;
97
38
  */
98
39
  export declare function defineConfig(configInput: PrismaConfig): PrismaConfigInternal;
99
40
 
100
- /**
101
- * A generic driver adapter factory that allows the user to instantiate a
102
- * driver adapter. The query and result types are specific to the adapter.
103
- */
104
- declare interface DriverAdapterFactory<Query, Result> extends AdapterInfo {
105
- /**
106
- * Instantiate a driver adapter.
107
- */
108
- connect(): Promise<Queryable<Query, Result>>;
109
- }
110
-
111
41
  declare type EnumsConfigShape = {
112
42
  /**
113
43
  * List of enums that are externally managed.
@@ -117,40 +47,15 @@ declare type EnumsConfigShape = {
117
47
  external?: string[];
118
48
  };
119
49
 
120
- export declare function env<Env extends Record<string, string | undefined>>(name: keyof Env & string): string;
121
-
122
- declare type Error_2 = MappedError & {
123
- originalCode?: string;
124
- originalMessage?: string;
125
- };
50
+ export declare function env(name: string): string;
126
51
 
127
- declare type ErrorCapturingFunction<T> = T extends (...args: infer A) => Promise<infer R> ? (...args: A) => Promise<Result<ErrorCapturingInterface<R>>> : T extends (...args: infer A) => infer R ? (...args: A) => Result<ErrorCapturingInterface<R>> : T;
52
+ export declare function env<Env>(name: EnvKey<Env> & string): string;
128
53
 
129
- declare type ErrorCapturingInterface<T> = {
130
- [K in keyof T]: ErrorCapturingFunction<T[K]>;
54
+ declare type EnvKey<Env> = keyof {
55
+ [K in keyof Env as Env[K] extends string | undefined ? K : never]: Env[K];
131
56
  };
132
57
 
133
- declare interface ErrorCapturingSqlMigrationAwareDriverAdapterFactory extends ErrorCapturingInterface<SqlMigrationAwareDriverAdapterFactory> {
134
- readonly errorRegistry: ErrorRegistry;
135
- }
136
-
137
- declare type ErrorRecord = {
138
- error: unknown;
139
- };
140
-
141
- declare interface ErrorRegistry {
142
- consumeError(id: number): ErrorRecord | undefined;
143
- }
144
-
145
58
  declare type ExperimentalConfig = {
146
- /**
147
- * Enable experimental adapter support.
148
- */
149
- adapter?: boolean;
150
- /**
151
- * Enable experimental Prisma Studio features.
152
- */
153
- studio?: boolean;
154
59
  /**
155
60
  * Enable experimental external tables support.
156
61
  */
@@ -168,8 +73,6 @@ export declare type InjectFormatters = {
168
73
  link: (data: string) => string;
169
74
  };
170
75
 
171
- declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE';
172
-
173
76
  /**
174
77
  * Load a Prisma config file from the given directory.
175
78
  * This function may fail, but it will never throw.
@@ -204,130 +107,6 @@ declare type LoadConfigFromFileInput = {
204
107
  configRoot?: string;
205
108
  };
206
109
 
207
- /**
208
- * User's Prisma configuration should live in `prisma.config.ts` instead of `package.json#prisma`.
209
- * See: https://pris.ly/prisma-config.
210
- *
211
- * This function returns `null` if no `package.json` is found, or if the `prisma` property is not defined therein.
212
- *
213
- * TODO: remove in Prisma 7.
214
- * @deprecated
215
- */
216
- export declare function loadConfigFromPackageJson(cwd?: string): Promise<{
217
- config: PrismaConfigPackageJson;
218
- loadedFromFile: string;
219
- } | null>;
220
-
221
- declare type MappedError = {
222
- kind: 'GenericJs';
223
- id: number;
224
- } | {
225
- kind: 'UnsupportedNativeDataType';
226
- type: string;
227
- } | {
228
- kind: 'InvalidIsolationLevel';
229
- level: string;
230
- } | {
231
- kind: 'LengthMismatch';
232
- column?: string;
233
- } | {
234
- kind: 'UniqueConstraintViolation';
235
- constraint?: {
236
- fields: string[];
237
- } | {
238
- index: string;
239
- } | {
240
- foreignKey: {};
241
- };
242
- } | {
243
- kind: 'NullConstraintViolation';
244
- constraint?: {
245
- fields: string[];
246
- } | {
247
- index: string;
248
- } | {
249
- foreignKey: {};
250
- };
251
- } | {
252
- kind: 'ForeignKeyConstraintViolation';
253
- constraint?: {
254
- fields: string[];
255
- } | {
256
- index: string;
257
- } | {
258
- foreignKey: {};
259
- };
260
- } | {
261
- kind: 'DatabaseNotReachable';
262
- host?: string;
263
- port?: number;
264
- } | {
265
- kind: 'DatabaseDoesNotExist';
266
- db?: string;
267
- } | {
268
- kind: 'DatabaseAlreadyExists';
269
- db?: string;
270
- } | {
271
- kind: 'DatabaseAccessDenied';
272
- db?: string;
273
- } | {
274
- kind: 'ConnectionClosed';
275
- } | {
276
- kind: 'TlsConnectionError';
277
- reason: string;
278
- } | {
279
- kind: 'AuthenticationFailed';
280
- user?: string;
281
- } | {
282
- kind: 'TransactionWriteConflict';
283
- } | {
284
- kind: 'TableDoesNotExist';
285
- table?: string;
286
- } | {
287
- kind: 'ColumnNotFound';
288
- column?: string;
289
- } | {
290
- kind: 'TooManyConnections';
291
- cause: string;
292
- } | {
293
- kind: 'ValueOutOfRange';
294
- cause: string;
295
- } | {
296
- kind: 'MissingFullTextSearchIndex';
297
- } | {
298
- kind: 'SocketTimeout';
299
- } | {
300
- kind: 'InconsistentColumnData';
301
- cause: string;
302
- } | {
303
- kind: 'TransactionAlreadyClosed';
304
- cause: string;
305
- } | {
306
- kind: 'postgres';
307
- code: string;
308
- severity: string;
309
- message: string;
310
- detail: string | undefined;
311
- column: string | undefined;
312
- hint: string | undefined;
313
- } | {
314
- kind: 'mysql';
315
- code: number;
316
- message: string;
317
- state: string;
318
- } | {
319
- kind: 'sqlite';
320
- /**
321
- * Sqlite extended error code: https://www.sqlite.org/rescode.html
322
- */
323
- extendedCode: number;
324
- message: string;
325
- } | {
326
- kind: 'mssql';
327
- code: number;
328
- message: string;
329
- };
330
-
331
110
  declare type MigrationsConfigShape = {
332
111
  /**
333
112
  * The path to the directory where Prisma should store migration files, and look for them.
@@ -344,90 +123,25 @@ declare type MigrationsConfigShape = {
344
123
  seed?: string;
345
124
  };
346
125
 
347
- declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-better-sqlite3", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-mssql", "@prisma/adapter-mariadb"];
348
-
349
126
  declare const PRISMA_CONFIG_INTERNAL_BRAND: unique symbol;
350
127
 
351
128
  /**
352
129
  * The configuration for the Prisma Development Kit, before it is passed to the `defineConfig` function.
353
130
  * Thanks to the branding, this type is opaque and cannot be constructed directly.
354
131
  */
355
- export declare type PrismaConfig = PrismaConfigUnconditional & SchemaEngineConfig;
356
-
357
- export declare class PrismaConfigEnvError extends Error {
358
- constructor(name: string);
359
- }
360
-
361
- /**
362
- * The configuration for the Prisma Development Kit, after it has been parsed and processed
363
- * by the `defineConfig` function.
364
- * Thanks to the branding, this type is opaque and cannot be constructed directly.
365
- */
366
- export declare type PrismaConfigInternal = _PrismaConfigInternal & {
367
- __brand: typeof PRISMA_CONFIG_INTERNAL_BRAND;
368
- };
369
-
370
- declare type _PrismaConfigInternal = Omit<PrismaConfig, 'engine' | 'datasource' | 'adapter'> & {
371
- loadedFromFile: string | null;
372
- /**
373
- * The deprecated Prisma configuration from `package.json#prisma`.
374
- * This is set to `null` if no `package.json#prisma` config was found.
375
- * The configuration read from the Prisma config file (e.g., `prisma.config.ts`) takes precedence over
376
- * this `package.json#prisma` config.
377
- * @deprecated
378
- */
379
- deprecatedPackageJson: {
380
- /**
381
- * The Prisma configuration from `package.json#prisma`.
382
- * @deprecated
383
- */
384
- config: PrismaConfigPackageJson;
385
- /**
386
- * The path from where the `package.json` config was loaded.
387
- * @deprecated
388
- */
389
- loadedFromFile: string;
390
- } | null;
391
- } & ({
392
- engine: 'classic';
393
- datasource: {
394
- url: string;
395
- shadowDatabaseUrl?: string;
396
- };
397
- } | {
398
- engine: 'js';
399
- adapter: () => Promise<ErrorCapturingSqlMigrationAwareDriverAdapterFactory>;
400
- } | {
401
- engine?: never;
402
- });
403
-
404
- /**
405
- * Example:
406
- * ```json
407
- * {
408
- * "schema": "./prisma/schema.prisma",
409
- * "seed": "tsx ./prisma/seed.ts"
410
- * }
411
- * ```
412
- */
413
- declare type PrismaConfigPackageJson = {
414
- schema?: string;
415
- seed?: string;
416
- };
417
-
418
- declare type PrismaConfigUnconditional = {
132
+ export declare type PrismaConfig = {
419
133
  /**
420
134
  * Experimental feature gates. Each experimental feature must be explicitly enabled.
421
135
  */
422
136
  experimental?: Simplify<ExperimentalConfig>;
423
137
  /**
424
- * The path to the schema file, or path to a folder that shall be recursively searched for *.prisma files.
138
+ * The datasource configuration. Optional for most cases, but required for migration / introspection commands.
425
139
  */
426
- schema?: string;
140
+ datasource?: Simplify<Datasource>;
427
141
  /**
428
- * The configuration for Prisma Studio.
142
+ * The path to the schema file, or path to a folder that shall be recursively searched for *.prisma files.
429
143
  */
430
- studio?: Simplify<PrismaStudioConfigShape>;
144
+ schema?: string;
431
145
  /**
432
146
  * Configuration for Prisma migrations.
433
147
  */
@@ -450,86 +164,27 @@ declare type PrismaConfigUnconditional = {
450
164
  typedSql?: Simplify<TypedSqlConfigShape>;
451
165
  };
452
166
 
453
- declare type PrismaStudioConfigShape = {
454
- adapter: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
455
- };
456
-
457
- declare type Provider = 'mysql' | 'postgres' | 'sqlite' | 'sqlserver';
458
-
459
- declare interface Queryable<Query, Result> extends AdapterInfo {
460
- /**
461
- * Execute a query and return its result.
462
- */
463
- queryRaw(params: Query): Promise<Result>;
464
- /**
465
- * Execute a query and return the number of affected rows.
466
- */
467
- executeRaw(params: Query): Promise<number>;
167
+ export declare class PrismaConfigEnvError extends Error {
168
+ constructor(name: string);
468
169
  }
469
170
 
470
- declare type Result<T> = {
471
- map<U>(fn: (value: T) => U): Result<U>;
472
- flatMap<U>(fn: (value: T) => Result<U>): Result<U>;
473
- } & ({
474
- readonly ok: true;
475
- readonly value: T;
476
- } | {
477
- readonly ok: false;
478
- readonly error: Error_2;
479
- });
480
-
481
- declare type SchemaEngineConfig = SchemaEngineConfigJs | SchemaEngineConfigClassic | SchemaEngineConfigAbsent;
482
-
483
- declare type SchemaEngineConfigAbsent = {
484
- engine?: never;
485
- };
486
-
487
- declare type SchemaEngineConfigClassic = {
488
- /**
489
- * Uses the "old classic" Schema Engine binary
490
- */
491
- engine: 'classic';
492
- /**
493
- * The database connection configuration, which overwrites the `datasource` block's `url`-like attributes in the Prisma schema file.
494
- */
495
- datasource: SchemaEngineConfigClassicDatasource;
171
+ /**
172
+ * The configuration for the Prisma Development Kit, after it has been parsed and processed
173
+ * by the `defineConfig` function.
174
+ * Thanks to the branding, this type is opaque and cannot be constructed directly.
175
+ */
176
+ export declare type PrismaConfigInternal = _PrismaConfigInternal & {
177
+ __brand: typeof PRISMA_CONFIG_INTERNAL_BRAND;
496
178
  };
497
179
 
498
- export declare type SchemaEngineConfigClassicDatasource = {
499
- url: string;
500
- directUrl?: string;
501
- shadowDatabaseUrl?: string;
180
+ declare type _PrismaConfigInternal = PrismaConfig & {
181
+ loadedFromFile: string | null;
502
182
  };
503
183
 
504
- export declare type SchemaEngineConfigInternal = SchemaEngineConfigJsInternal | SchemaEngineConfigClassic | SchemaEngineConfigAbsent;
505
-
506
- declare type SchemaEngineConfigJs = {
507
- /**
508
- * Uses the new, unstable JavaScript based Schema Engine.
509
- */
510
- engine: 'js';
511
- /**
512
- * The function that instantiates the driver adapter to use for the JavaScript based Schema Engine.
513
- */
514
- adapter: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
184
+ export declare type SchemaEngineConfigInternal = {
185
+ datasource?: Datasource;
515
186
  };
516
187
 
517
- declare type SchemaEngineConfigJsInternal = {
518
- /**
519
- * Uses the new, unstable JavaScript based Schema Engine.
520
- */
521
- engine: 'js';
522
- /**
523
- * The function that instantiates the driver adapter to use for the JavaScript based Schema Engine.
524
- */
525
- adapter: () => Promise<ErrorCapturingSqlMigrationAwareDriverAdapterFactory>;
526
- };
527
-
528
- declare const SchemaEngineConfigJsInternal: Schema.Struct<{
529
- engine: Schema.Literal<["js"]>;
530
- adapter: Schema.declare<() => Promise<ErrorCapturingSqlMigrationAwareDriverAdapterFactory>, () => Promise<ErrorCapturingSqlMigrationAwareDriverAdapterFactory>, readonly [], never>;
531
- }>;
532
-
533
188
  /**
534
189
  * Simplifies the type signature of a type.
535
190
  * Re-exported from `effect/Types`.
@@ -543,68 +198,6 @@ declare type Simplify<A> = {
543
198
  [K in keyof A]: A[K];
544
199
  } extends infer B ? B : never;
545
200
 
546
- declare interface SqlDriverAdapter extends SqlQueryable {
547
- /**
548
- * Execute multiple SQL statements separated by semicolon.
549
- */
550
- executeScript(script: string): Promise<void>;
551
- /**
552
- * Start new transaction.
553
- */
554
- startTransaction(isolationLevel?: IsolationLevel): Promise<Transaction>;
555
- /**
556
- * Optional method that returns extra connection info
557
- */
558
- getConnectionInfo?(): ConnectionInfo;
559
- /**
560
- * Dispose of the connection and release any resources.
561
- */
562
- dispose(): Promise<void>;
563
- }
564
-
565
- declare interface SqlDriverAdapterFactory extends DriverAdapterFactory<SqlQuery, SqlResultSet> {
566
- connect(): Promise<SqlDriverAdapter>;
567
- }
568
-
569
- /**
570
- * An SQL migration adapter that is aware of the notion of a shadow database
571
- * and can create a connection to it.
572
- */
573
- declare interface SqlMigrationAwareDriverAdapterFactory extends SqlDriverAdapterFactory {
574
- connectToShadowDb(): Promise<SqlDriverAdapter>;
575
- }
576
-
577
- declare type SqlQuery = {
578
- sql: string;
579
- args: Array<unknown>;
580
- argTypes: Array<ArgType>;
581
- };
582
-
583
- declare interface SqlQueryable extends Queryable<SqlQuery, SqlResultSet> {
584
- }
585
-
586
- declare interface SqlResultSet {
587
- /**
588
- * List of column types appearing in a database query, in the same order as `columnNames`.
589
- * They are used within the Query Engine to convert values from JS to Quaint values.
590
- */
591
- columnTypes: Array<ColumnType>;
592
- /**
593
- * List of column names appearing in a database query, in the same order as `columnTypes`.
594
- */
595
- columnNames: Array<string>;
596
- /**
597
- * List of rows retrieved from a database query.
598
- * Each row is a list of values, whose length matches `columnNames` and `columnTypes`.
599
- */
600
- rows: Array<Array<unknown>>;
601
- /**
602
- * The last ID of an `INSERT` statement, if any.
603
- * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite.
604
- */
605
- lastInsertId?: string;
606
- }
607
-
608
201
  declare type TablesConfigShape = {
609
202
  /**
610
203
  * List of tables that are externally managed.
@@ -614,25 +207,6 @@ declare type TablesConfigShape = {
614
207
  external?: string[];
615
208
  };
616
209
 
617
- declare interface Transaction extends AdapterInfo, SqlQueryable {
618
- /**
619
- * Transaction options.
620
- */
621
- readonly options: TransactionOptions;
622
- /**
623
- * Commit the transaction.
624
- */
625
- commit(): Promise<void>;
626
- /**
627
- * Roll back the transaction.
628
- */
629
- rollback(): Promise<void>;
630
- }
631
-
632
- declare type TransactionOptions = {
633
- usePhantomQuery: boolean;
634
- };
635
-
636
210
  declare type TypedSqlConfigShape = {
637
211
  /**
638
212
  * The path to the directory where Prisma should look for the `typedSql` queries, where *.sql files will be loaded.
package/dist/index.js CHANGED
@@ -34,8 +34,7 @@ __export(index_exports, {
34
34
  defaultTestConfig: () => defaultTestConfig,
35
35
  defineConfig: () => defineConfig,
36
36
  env: () => env,
37
- loadConfigFromFile: () => loadConfigFromFile,
38
- loadConfigFromPackageJson: () => loadConfigFromPackageJson
37
+ loadConfigFromFile: () => loadConfigFromFile
39
38
  });
40
39
  module.exports = __toCommonJS(index_exports);
41
40
 
@@ -225,140 +224,8 @@ function safeStringify(value, indent = 2) {
225
224
  );
226
225
  }
227
226
 
228
- // ../driver-adapter-utils/dist/index.mjs
229
- function isDriverAdapterError(error) {
230
- return error["name"] === "DriverAdapterError" && typeof error["cause"] === "object";
231
- }
232
- function ok(value) {
233
- return {
234
- ok: true,
235
- value,
236
- map(fn) {
237
- return ok(fn(value));
238
- },
239
- flatMap(fn) {
240
- return fn(value);
241
- }
242
- };
243
- }
244
- function err(error) {
245
- return {
246
- ok: false,
247
- error,
248
- map() {
249
- return err(error);
250
- },
251
- flatMap() {
252
- return err(error);
253
- }
254
- };
255
- }
256
- var debug = Debug("driver-adapter-utils");
257
- var ErrorRegistryInternal = class {
258
- registeredErrors = [];
259
- consumeError(id) {
260
- return this.registeredErrors[id];
261
- }
262
- registerNewError(error) {
263
- let i = 0;
264
- while (this.registeredErrors[i] !== void 0) {
265
- i++;
266
- }
267
- this.registeredErrors[i] = { error };
268
- return i;
269
- }
270
- };
271
- function copySymbolsFromSource(source, target) {
272
- const symbols = Object.getOwnPropertySymbols(source);
273
- const symbolObject = Object.fromEntries(symbols.map((symbol) => [symbol, true]));
274
- Object.assign(target, symbolObject);
275
- }
276
- var bindMigrationAwareSqlAdapterFactory = (adapterFactory) => {
277
- const errorRegistry = new ErrorRegistryInternal();
278
- const boundFactory = {
279
- adapterName: adapterFactory.adapterName,
280
- provider: adapterFactory.provider,
281
- errorRegistry,
282
- connect: async (...args) => {
283
- const ctx = await wrapAsync(errorRegistry, adapterFactory.connect.bind(adapterFactory))(...args);
284
- return ctx.map((ctx2) => bindAdapter(ctx2, errorRegistry));
285
- },
286
- connectToShadowDb: async (...args) => {
287
- const ctx = await wrapAsync(errorRegistry, adapterFactory.connectToShadowDb.bind(adapterFactory))(...args);
288
- return ctx.map((ctx2) => bindAdapter(ctx2, errorRegistry));
289
- }
290
- };
291
- copySymbolsFromSource(adapterFactory, boundFactory);
292
- return boundFactory;
293
- };
294
- var bindAdapter = (adapter, errorRegistry = new ErrorRegistryInternal()) => {
295
- const boundAdapter = {
296
- adapterName: adapter.adapterName,
297
- errorRegistry,
298
- queryRaw: wrapAsync(errorRegistry, adapter.queryRaw.bind(adapter)),
299
- executeRaw: wrapAsync(errorRegistry, adapter.executeRaw.bind(adapter)),
300
- executeScript: wrapAsync(errorRegistry, adapter.executeScript.bind(adapter)),
301
- dispose: wrapAsync(errorRegistry, adapter.dispose.bind(adapter)),
302
- provider: adapter.provider,
303
- startTransaction: async (...args) => {
304
- const ctx = await wrapAsync(errorRegistry, adapter.startTransaction.bind(adapter))(...args);
305
- return ctx.map((ctx2) => bindTransaction(errorRegistry, ctx2));
306
- }
307
- };
308
- if (adapter.getConnectionInfo) {
309
- boundAdapter.getConnectionInfo = wrapSync(errorRegistry, adapter.getConnectionInfo.bind(adapter));
310
- }
311
- return boundAdapter;
312
- };
313
- var bindTransaction = (errorRegistry, transaction) => {
314
- return {
315
- adapterName: transaction.adapterName,
316
- provider: transaction.provider,
317
- options: transaction.options,
318
- queryRaw: wrapAsync(errorRegistry, transaction.queryRaw.bind(transaction)),
319
- executeRaw: wrapAsync(errorRegistry, transaction.executeRaw.bind(transaction)),
320
- commit: wrapAsync(errorRegistry, transaction.commit.bind(transaction)),
321
- rollback: wrapAsync(errorRegistry, transaction.rollback.bind(transaction))
322
- };
323
- };
324
- function wrapAsync(registry, fn) {
325
- return async (...args) => {
326
- try {
327
- return ok(await fn(...args));
328
- } catch (error) {
329
- debug("[error@wrapAsync]", error);
330
- if (isDriverAdapterError(error)) {
331
- return err(error.cause);
332
- }
333
- const id = registry.registerNewError(error);
334
- return err({ kind: "GenericJs", id });
335
- }
336
- };
337
- }
338
- function wrapSync(registry, fn) {
339
- return (...args) => {
340
- try {
341
- return ok(fn(...args));
342
- } catch (error) {
343
- debug("[error@wrapSync]", error);
344
- if (isDriverAdapterError(error)) {
345
- return err(error.cause);
346
- }
347
- const id = registry.registerNewError(error);
348
- return err({ kind: "GenericJs", id });
349
- }
350
- };
351
- }
352
- var mockAdapterErrors = {
353
- queryRaw: new Error("Not implemented: queryRaw"),
354
- executeRaw: new Error("Not implemented: executeRaw"),
355
- startTransaction: new Error("Not implemented: startTransaction"),
356
- executeScript: new Error("Not implemented: executeScript"),
357
- dispose: new Error("Not implemented: dispose")
358
- };
359
-
360
227
  // src/PrismaConfig.ts
361
- var import_effect3 = require("effect");
228
+ var import_effect2 = require("effect");
362
229
  var import_Function = require("effect/Function");
363
230
 
364
231
  // src/defineConfig.ts
@@ -367,22 +234,13 @@ var import_effect = require("effect");
367
234
  // src/defaultConfig.ts
368
235
  function defaultConfig() {
369
236
  return makePrismaConfigInternal({
370
- loadedFromFile: null,
371
- deprecatedPackageJson: null
237
+ loadedFromFile: null
372
238
  });
373
239
  }
374
240
 
375
241
  // src/defineConfig.ts
376
242
  function validateExperimentalFeatures(config) {
377
243
  const experimental = config.experimental || {};
378
- if (config.engine === "js" && !experimental.adapter) {
379
- return import_effect.Either.left(
380
- new Error('The `engine === "js"` configuration requires `experimental.adapter` to be set to `true`.')
381
- );
382
- }
383
- if (config.studio && !experimental.studio) {
384
- return import_effect.Either.left(new Error("The `studio` configuration requires `experimental.studio` to be set to `true`."));
385
- }
386
244
  if (config.tables?.external && !experimental.externalTables) {
387
245
  return import_effect.Either.left(
388
246
  new Error("The `tables.external` configuration requires `experimental.externalTables` to be set to `true`.")
@@ -402,18 +260,17 @@ function validateExperimentalFeatures(config) {
402
260
  }
403
261
  return import_effect.Either.right(config);
404
262
  }
405
- var debug2 = Debug("prisma:config:defineConfig");
263
+ var debug = Debug("prisma:config:defineConfig");
406
264
  function defineConfig(configInput) {
407
265
  const validationResult = validateExperimentalFeatures(configInput);
408
266
  if (validationResult._tag === "Left") {
409
267
  throw validationResult.left;
410
268
  }
411
269
  const config = defaultConfig();
412
- debug2("[default]: %o", config);
270
+ debug("[default]: %o", config);
413
271
  defineExperimentalConfig(config, configInput);
414
272
  defineSchemaConfig(config, configInput);
415
- defineEngineConfig(config, configInput);
416
- defineStudioConfig(config, configInput);
273
+ defineDatasource(config, configInput);
417
274
  defineMigrationsConfig(config, configInput);
418
275
  defineTablesConfig(config, configInput);
419
276
  defineEnumsConfig(config, configInput);
@@ -427,306 +284,172 @@ function defineExperimentalConfig(config, configInput) {
427
284
  return;
428
285
  }
429
286
  config.experimental = configInput.experimental;
430
- debug2("[config.experimental]: %o", config.experimental);
287
+ debug("[config.experimental]: %o", config.experimental);
431
288
  }
432
289
  function defineSchemaConfig(config, configInput) {
433
290
  if (!configInput.schema) {
434
291
  return;
435
292
  }
436
293
  config.schema = configInput.schema;
437
- debug2("[config.schema]: %o", config.schema);
294
+ debug("[config.schema]: %o", config.schema);
438
295
  }
439
296
  function defineMigrationsConfig(config, configInput) {
440
297
  if (!configInput.migrations) {
441
298
  return;
442
299
  }
443
300
  config.migrations = configInput.migrations;
444
- debug2("[config.migrations]: %o", config.migrations);
301
+ debug("[config.migrations]: %o", config.migrations);
445
302
  }
446
303
  function defineTypedSqlConfig(config, configInput) {
447
304
  if (!configInput.typedSql) {
448
305
  return;
449
306
  }
450
307
  config.typedSql = configInput.typedSql;
451
- debug2("[config.typedSql]: %o", config.typedSql);
308
+ debug("[config.typedSql]: %o", config.typedSql);
452
309
  }
453
310
  function defineViewsConfig(config, configInput) {
454
311
  if (!configInput.views) {
455
312
  return;
456
313
  }
457
314
  config.views = configInput.views;
458
- debug2("[config.views]: %o", config.views);
315
+ debug("[config.views]: %o", config.views);
459
316
  }
460
317
  function defineTablesConfig(config, configInput) {
461
318
  if (!configInput.tables) {
462
319
  return;
463
320
  }
464
321
  config.tables = configInput.tables;
465
- debug2("[config.tables]: %o", config.tables);
322
+ debug("[config.tables]: %o", config.tables);
466
323
  }
467
324
  function defineEnumsConfig(config, configInput) {
468
325
  if (!configInput.enums) {
469
326
  return;
470
327
  }
471
328
  config.enums = configInput.enums;
472
- debug2("[config.enums]: %o", config.enums);
329
+ debug("[config.enums]: %o", config.enums);
473
330
  }
474
- function defineStudioConfig(config, configInput) {
475
- if (!configInput.studio?.adapter) {
476
- return;
477
- }
478
- const { adapter: getAdapterFactory } = configInput.studio;
479
- config.studio = {
480
- adapter: async () => {
481
- const adapterFactory = await getAdapterFactory();
482
- debug2("[config.studio.adapter]: %o", adapterFactory.adapterName);
483
- return adapterFactory;
484
- }
485
- };
486
- debug2("[config.studio]: %o", config.studio);
487
- }
488
- function defineEngineConfig(config, configInput) {
489
- if (configInput.engine === void 0) {
490
- return;
491
- } else if (configInput.engine === "js") {
492
- const { engine, adapter: getAdapterFactory } = configInput;
493
- const adapter = async () => {
494
- const adapterFactory = await getAdapterFactory();
495
- debug2("[config.adapter]: %o", adapterFactory.adapterName);
496
- return bindMigrationAwareSqlAdapterFactory(adapterFactory);
497
- };
498
- Object.assign(config, { engine, adapter });
499
- debug2("[config.engine]: %o", engine);
500
- debug2("[config.adapter]: %o", adapter);
501
- } else if (configInput.engine === "classic") {
502
- const { engine, datasource } = configInput;
503
- Object.assign(config, { engine, datasource });
504
- debug2("[config.engine]: %o", engine);
505
- debug2("[config.datasource]: %o", datasource);
506
- }
331
+ function defineDatasource(config, configInput) {
332
+ const { datasource } = configInput;
333
+ Object.assign(config, { datasource });
334
+ debug("[config.datasource]: %o", datasource);
507
335
  }
508
336
  function defineExtensionsConfig(config, configInput) {
509
337
  if (!configInput["extensions"]) {
510
338
  return;
511
339
  }
512
340
  config["extensions"] = configInput["extensions"];
513
- debug2("[config.extensions]: %o", config["extensions"]);
514
- }
515
-
516
- // src/loadConfigFromPackageJson.ts
517
- var import_promises = require("node:fs/promises");
518
- var import_node_process = __toESM(require("node:process"));
519
- var import_effect2 = require("effect");
520
- var import_package = require("empathic/package");
521
- var PrismaConfigPackageJsonShape = import_effect2.Schema.Struct({
522
- schema: import_effect2.Schema.optional(import_effect2.Schema.String),
523
- seed: import_effect2.Schema.optional(import_effect2.Schema.NonEmptyString)
524
- });
525
- async function loadConfigFromPackageJson(cwd = import_node_process.default.cwd()) {
526
- const pkgPath = (0, import_package.up)({ cwd });
527
- if (pkgPath === void 0) {
528
- return null;
529
- }
530
- const pkgJson = await (0, import_promises.readFile)(pkgPath, { encoding: "utf-8" }).then((p) => JSON.parse(p));
531
- const deprecatedConfig = pkgJson["prisma"];
532
- if (deprecatedConfig === void 0) {
533
- return null;
534
- }
535
- if (Object.keys(deprecatedConfig).length === 1 && deprecatedConfig["prismaCommit"] !== void 0) {
536
- return null;
537
- }
538
- return {
539
- config: deprecatedConfig,
540
- loadedFromFile: pkgPath
541
- };
341
+ debug("[config.extensions]: %o", config["extensions"]);
542
342
  }
543
343
 
544
344
  // src/PrismaConfig.ts
545
- var debug3 = Debug("prisma:config:PrismaConfig");
546
- var SqlMigrationAwareDriverAdapterFactoryShape = import_effect3.Schema.declare(
547
- (input) => {
548
- return typeof input === "function";
549
- },
550
- {
551
- identifier: "SqlMigrationAwareDriverAdapterFactory",
552
- encode: import_effect3.identity,
553
- decode: import_effect3.identity
554
- }
555
- );
556
- var ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape = import_effect3.Schema.declare(
557
- (input) => {
558
- return typeof input === "function";
559
- },
560
- {
561
- identifier: "ErrorCapturingSqlMigrationAwareDriverAdapterFactory",
562
- encode: import_effect3.identity,
563
- decode: import_effect3.identity
564
- }
565
- );
566
- var SchemaEngineConfigClassicShape = import_effect3.Schema.Struct({
567
- engine: import_effect3.Schema.Literal("classic"),
568
- datasource: import_effect3.Schema.Struct({
569
- url: import_effect3.Schema.String,
570
- directUrl: import_effect3.Schema.optional(import_effect3.Schema.String),
571
- shadowDatabaseUrl: import_effect3.Schema.optional(import_effect3.Schema.String)
572
- })
573
- });
574
- var SchemaEngineConfigJsShape = import_effect3.Schema.Struct({
575
- engine: import_effect3.Schema.Literal("js"),
576
- adapter: SqlMigrationAwareDriverAdapterFactoryShape
345
+ var debug2 = Debug("prisma:config:PrismaConfig");
346
+ var DatasourceShape = import_effect2.Schema.Struct({
347
+ url: import_effect2.Schema.optional(import_effect2.Schema.String),
348
+ shadowDatabaseUrl: import_effect2.Schema.optional(import_effect2.Schema.String)
577
349
  });
578
- var SchemaEngineConfigAbsentShape = import_effect3.Schema.Struct({
579
- engine: import_effect3.Schema.optional(import_effect3.Schema.Never)
580
- });
581
- var SchemaEngineConfigShape = import_effect3.Schema.Union(
582
- SchemaEngineConfigClassicShape,
583
- SchemaEngineConfigJsShape,
584
- SchemaEngineConfigAbsentShape
585
- );
586
- var SchemaEngineConfigJsInternal = import_effect3.Schema.Struct({
587
- engine: import_effect3.Schema.Literal("js"),
588
- adapter: ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape
589
- });
590
- var SchemaEngineConfigInternal = import_effect3.Schema.Union(
591
- SchemaEngineConfigClassicShape,
592
- SchemaEngineConfigJsInternal,
593
- SchemaEngineConfigAbsentShape
594
- );
595
- var ExperimentalConfigShape = import_effect3.Schema.Struct({
596
- adapter: import_effect3.Schema.optional(import_effect3.Schema.Boolean),
597
- studio: import_effect3.Schema.optional(import_effect3.Schema.Boolean),
598
- externalTables: import_effect3.Schema.optional(import_effect3.Schema.Boolean),
599
- extensions: import_effect3.Schema.optional(import_effect3.Schema.Boolean)
350
+ var ExperimentalConfigShape = import_effect2.Schema.Struct({
351
+ externalTables: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
352
+ extensions: import_effect2.Schema.optional(import_effect2.Schema.Boolean)
600
353
  });
601
354
  if (false) {
602
355
  __testExperimentalConfigShapeValueA;
603
356
  __testExperimentalConfigShapeValueB;
604
357
  }
605
- var MigrationsConfigShape = import_effect3.Schema.Struct({
606
- path: import_effect3.Schema.optional(import_effect3.Schema.String),
607
- initShadowDb: import_effect3.Schema.optional(import_effect3.Schema.String),
608
- seed: import_effect3.Schema.optional(import_effect3.Schema.NonEmptyString)
358
+ var MigrationsConfigShape = import_effect2.Schema.Struct({
359
+ path: import_effect2.Schema.optional(import_effect2.Schema.String),
360
+ initShadowDb: import_effect2.Schema.optional(import_effect2.Schema.String),
361
+ seed: import_effect2.Schema.optional(import_effect2.Schema.NonEmptyString)
609
362
  });
610
363
  if (false) {
611
364
  __testMigrationsConfigShapeValueA;
612
365
  __testMigrationsConfigShapeValueB;
613
366
  }
614
- var TablesConfigShape = import_effect3.Schema.Struct({
615
- external: import_effect3.Schema.optional(import_effect3.Schema.mutable(import_effect3.Schema.Array(import_effect3.Schema.String)))
367
+ var TablesConfigShape = import_effect2.Schema.Struct({
368
+ external: import_effect2.Schema.optional(import_effect2.Schema.mutable(import_effect2.Schema.Array(import_effect2.Schema.String)))
616
369
  });
617
370
  if (false) {
618
371
  __testTablesConfigShapeValueA;
619
372
  __testTablesConfigShapeValueB;
620
373
  }
621
- var EnumsConfigShape = import_effect3.Schema.Struct({
622
- external: import_effect3.Schema.optional(import_effect3.Schema.mutable(import_effect3.Schema.Array(import_effect3.Schema.String)))
374
+ var EnumsConfigShape = import_effect2.Schema.Struct({
375
+ external: import_effect2.Schema.optional(import_effect2.Schema.mutable(import_effect2.Schema.Array(import_effect2.Schema.String)))
623
376
  });
624
377
  if (false) {
625
378
  __testEnumsConfigShapeValueA;
626
379
  __testEnumsConfigShapeValueB;
627
380
  }
628
- var ViewsConfigShape = import_effect3.Schema.Struct({
629
- path: import_effect3.Schema.optional(import_effect3.Schema.String)
381
+ var ViewsConfigShape = import_effect2.Schema.Struct({
382
+ path: import_effect2.Schema.optional(import_effect2.Schema.String)
630
383
  });
631
384
  if (false) {
632
385
  __testViewsConfigShapeValueA;
633
386
  __testViewsConfigShapeValueB;
634
387
  }
635
- var TypedSqlConfigShape = import_effect3.Schema.Struct({
636
- path: import_effect3.Schema.optional(import_effect3.Schema.String)
388
+ var TypedSqlConfigShape = import_effect2.Schema.Struct({
389
+ path: import_effect2.Schema.optional(import_effect2.Schema.String)
637
390
  });
638
391
  if (false) {
639
392
  __testTypedSqlConfigShapeValueA;
640
393
  __testTypedSqlConfigShapeValueB;
641
394
  }
642
- var PrismaStudioConfigShape = import_effect3.Schema.Struct({
643
- /**
644
- * Instantiates the Prisma driver adapter to use for Prisma Studio.
645
- */
646
- adapter: SqlMigrationAwareDriverAdapterFactoryShape
647
- });
648
- if (false) {
649
- __testPrismaStudioConfigShapeValueA;
650
- __testPrismaStudioConfigShapeValueB;
651
- }
652
395
  if (false) {
653
396
  __testPrismaConfig;
654
397
  __testPrismaConfigInternal;
655
398
  }
656
- var PrismaConfigUnconditionalShape = import_effect3.Schema.Struct({
657
- experimental: import_effect3.Schema.optional(ExperimentalConfigShape),
658
- schema: import_effect3.Schema.optional(import_effect3.Schema.String),
659
- studio: import_effect3.Schema.optional(PrismaStudioConfigShape),
660
- migrations: import_effect3.Schema.optional(MigrationsConfigShape),
661
- tables: import_effect3.Schema.optional(TablesConfigShape),
662
- enums: import_effect3.Schema.optional(EnumsConfigShape),
663
- views: import_effect3.Schema.optional(ViewsConfigShape),
664
- typedSql: import_effect3.Schema.optional(TypedSqlConfigShape),
665
- extensions: import_effect3.Schema.optional(import_effect3.Schema.Any)
399
+ var PrismaConfigShape = import_effect2.Schema.Struct({
400
+ experimental: import_effect2.Schema.optional(ExperimentalConfigShape),
401
+ datasource: import_effect2.Schema.optional(DatasourceShape),
402
+ schema: import_effect2.Schema.optional(import_effect2.Schema.String),
403
+ migrations: import_effect2.Schema.optional(MigrationsConfigShape),
404
+ tables: import_effect2.Schema.optional(TablesConfigShape),
405
+ enums: import_effect2.Schema.optional(EnumsConfigShape),
406
+ views: import_effect2.Schema.optional(ViewsConfigShape),
407
+ typedSql: import_effect2.Schema.optional(TypedSqlConfigShape),
408
+ extensions: import_effect2.Schema.optional(import_effect2.Schema.Any)
666
409
  });
667
- var PrismaConfigShape = import_effect3.Schema.extend(SchemaEngineConfigShape, PrismaConfigUnconditionalShape);
668
410
  if (false) {
669
411
  __testPrismaConfigValueA;
670
412
  __testPrismaConfigValueB;
671
413
  }
672
414
  function validateExperimentalFeatures2(config) {
673
415
  const experimental = config.experimental || {};
674
- if (config.engine === "js" && !experimental.adapter) {
675
- return import_effect3.Either.left(
676
- new Error("The `engine === 'js'` configuration requires `experimental.adapter` to be set to `true`.")
677
- );
678
- }
679
- if (config.studio && !experimental.studio) {
680
- return import_effect3.Either.left(new Error("The `studio` configuration requires `experimental.studio` to be set to `true`."));
681
- }
682
416
  if (config.tables?.external && !experimental.externalTables) {
683
- return import_effect3.Either.left(
417
+ return import_effect2.Either.left(
684
418
  new Error("The `tables.external` configuration requires `experimental.externalTables` to be set to `true`.")
685
419
  );
686
420
  }
687
421
  if (config.enums?.external && !experimental.externalTables) {
688
- return import_effect3.Either.left(
422
+ return import_effect2.Either.left(
689
423
  new Error("The `enums.external` configuration requires `experimental.externalTables` to be set to `true`.")
690
424
  );
691
425
  }
692
426
  if (config.migrations?.initShadowDb && !experimental.externalTables) {
693
- return import_effect3.Either.left(
427
+ return import_effect2.Either.left(
694
428
  new Error(
695
429
  "The `migrations.initShadowDb` configuration requires `experimental.externalTables` to be set to `true`."
696
430
  )
697
431
  );
698
432
  }
699
433
  if (config["extensions"] && !experimental.extensions) {
700
- return import_effect3.Either.left(
434
+ return import_effect2.Either.left(
701
435
  new Error("The `extensions` configuration requires `experimental.extensions` to be set to `true`.")
702
436
  );
703
437
  }
704
- return import_effect3.Either.right(config);
438
+ return import_effect2.Either.right(config);
705
439
  }
706
440
  function parsePrismaConfigShape(input) {
707
441
  return (0, import_Function.pipe)(
708
- import_effect3.Schema.decodeUnknownEither(PrismaConfigShape, {})(input, {
442
+ import_effect2.Schema.decodeUnknownEither(PrismaConfigShape, {})(input, {
709
443
  onExcessProperty: "error"
710
444
  }),
711
- import_effect3.Either.flatMap(validateExperimentalFeatures2)
445
+ import_effect2.Either.flatMap(validateExperimentalFeatures2)
712
446
  );
713
447
  }
714
448
  var PRISMA_CONFIG_INTERNAL_BRAND = Symbol.for("PrismaConfigInternal");
715
- var PrismaConfigInternalShape = import_effect3.Schema.extend(
716
- PrismaConfigUnconditionalShape,
717
- import_effect3.Schema.extend(
718
- SchemaEngineConfigInternal,
719
- import_effect3.Schema.Struct({
720
- loadedFromFile: import_effect3.Schema.NullOr(import_effect3.Schema.String),
721
- deprecatedPackageJson: import_effect3.Schema.NullOr(
722
- import_effect3.Schema.Struct({
723
- config: PrismaConfigPackageJsonShape,
724
- loadedFromFile: import_effect3.Schema.String
725
- })
726
- )
727
- })
728
- )
729
- );
449
+ var PrismaConfigInternalShape = import_effect2.Schema.Struct({
450
+ ...PrismaConfigShape.fields,
451
+ loadedFromFile: import_effect2.Schema.NullOr(import_effect2.Schema.String)
452
+ });
730
453
  function brandPrismaConfigInternal(config) {
731
454
  Object.defineProperty(config, "__brand", {
732
455
  value: PRISMA_CONFIG_INTERNAL_BRAND,
@@ -737,13 +460,13 @@ function brandPrismaConfigInternal(config) {
737
460
  return config;
738
461
  }
739
462
  function parsePrismaConfigInternalShape(input) {
740
- debug3("Parsing PrismaConfigInternal: %o", input);
463
+ debug2("Parsing PrismaConfigInternal: %o", input);
741
464
  if (typeof input === "object" && input !== null && input["__brand"] === PRISMA_CONFIG_INTERNAL_BRAND) {
742
- debug3("Short-circuit: input is already a PrismaConfigInternal object");
743
- return import_effect3.Either.right(input);
465
+ debug2("Short-circuit: input is already a PrismaConfigInternal object");
466
+ return import_effect2.Either.right(input);
744
467
  }
745
468
  return (0, import_Function.pipe)(
746
- import_effect3.Schema.decodeUnknownEither(PrismaConfigInternalShape, {})(input, {
469
+ import_effect2.Schema.decodeUnknownEither(PrismaConfigInternalShape, {})(input, {
747
470
  onExcessProperty: "error"
748
471
  }),
749
472
  // Brand the output type to make `PrismaConfigInternal` opaque, without exposing the `Effect/Brand` type
@@ -752,24 +475,24 @@ function parsePrismaConfigInternalShape(input) {
752
475
  // - https://github.com/microsoft/rushstack/issues/1308
753
476
  // - https://github.com/microsoft/rushstack/issues/4034
754
477
  // - https://github.com/microsoft/TypeScript/issues/58914
755
- import_effect3.Either.map(brandPrismaConfigInternal)
478
+ import_effect2.Either.map(brandPrismaConfigInternal)
756
479
  );
757
480
  }
758
481
  function makePrismaConfigInternal(makeArgs) {
759
- return brandPrismaConfigInternal(makeArgs);
482
+ return (0, import_Function.pipe)(PrismaConfigInternalShape.make(makeArgs), brandPrismaConfigInternal);
760
483
  }
761
484
  function parseDefaultExport(defaultExport) {
762
485
  const parseResultEither = (0, import_Function.pipe)(
763
486
  // If the given config conforms to the `PrismaConfig` shape, feed it to `defineConfig`.
764
487
  parsePrismaConfigShape(defaultExport),
765
- import_effect3.Either.map((config) => {
766
- debug3("Parsed `PrismaConfig` shape: %o", config);
488
+ import_effect2.Either.map((config) => {
489
+ debug2("Parsed `PrismaConfig` shape: %o", config);
767
490
  return defineConfig(config);
768
491
  }),
769
492
  // Otherwise, try to parse it as a `PrismaConfigInternal` shape.
770
- import_effect3.Either.orElse(() => parsePrismaConfigInternalShape(defaultExport))
493
+ import_effect2.Either.orElse(() => parsePrismaConfigInternalShape(defaultExport))
771
494
  );
772
- if (import_effect3.Either.isLeft(parseResultEither)) {
495
+ if (import_effect2.Either.isLeft(parseResultEither)) {
773
496
  throw parseResultEither.left;
774
497
  }
775
498
  return parseResultEither.right;
@@ -778,15 +501,14 @@ function parseDefaultExport(defaultExport) {
778
501
  // src/defaultTestConfig.ts
779
502
  function defaultTestConfig() {
780
503
  return makePrismaConfigInternal({
781
- loadedFromFile: null,
782
- deprecatedPackageJson: null
504
+ loadedFromFile: null
783
505
  });
784
506
  }
785
507
 
786
508
  // src/env.ts
787
509
  var PrismaConfigEnvError = class extends Error {
788
510
  constructor(name) {
789
- super(`Missing required environment variable: ${name}`);
511
+ super(`Cannot resolve environment variable: ${name}.`);
790
512
  this.name = "PrismaConfigEnvError";
791
513
  }
792
514
  };
@@ -800,27 +522,16 @@ function env(name) {
800
522
 
801
523
  // src/loadConfigFromFile.ts
802
524
  var import_node_path = __toESM(require("node:path"));
803
- var import_node_process2 = __toESM(require("node:process"));
804
- var debug4 = Debug("prisma:config:loadConfigFromFile");
525
+ var import_node_process = __toESM(require("node:process"));
526
+ var debug3 = Debug("prisma:config:loadConfigFromFile");
805
527
  var SUPPORTED_EXTENSIONS = [".js", ".ts", ".mjs", ".cjs", ".mts", ".cts"];
806
528
  async function loadConfigFromFile({
807
529
  configFile,
808
- configRoot = import_node_process2.default.cwd()
530
+ configRoot = import_node_process.default.cwd()
809
531
  }) {
810
532
  const start = performance.now();
811
533
  const getTime = () => `${(performance.now() - start).toFixed(2)}ms`;
812
534
  const diagnostics = [];
813
- const deprecatedPrismaConfigFromJson = await loadConfigFromPackageJson(configRoot);
814
- if (deprecatedPrismaConfigFromJson) {
815
- diagnostics.push({
816
- _tag: "warn",
817
- value: ({ warn, link }) => () => warn(
818
- `The configuration property \`package.json#prisma\` is deprecated and will be removed in Prisma 7. Please migrate to a Prisma config file (e.g., \`prisma.config.ts\`).
819
- For more information, see: ${link("https://pris.ly/prisma-config")}
820
- `
821
- )
822
- });
823
- }
824
535
  try {
825
536
  const { configModule, resolvedPath, error } = await loadConfigTsOrJs(configRoot, configFile);
826
537
  if (error) {
@@ -830,9 +541,9 @@ For more information, see: ${link("https://pris.ly/prisma-config")}
830
541
  diagnostics
831
542
  };
832
543
  }
833
- debug4(`Config file loaded in %s`, getTime());
544
+ debug3(`Config file loaded in %s`, getTime());
834
545
  if (resolvedPath === null) {
835
- debug4(`No config file found in the current working directory %s`, configRoot);
546
+ debug3(`No config file found in the current working directory %s`, configRoot);
836
547
  return { resolvedPath: null, config: defaultConfig(), diagnostics };
837
548
  }
838
549
  let parsedConfig;
@@ -855,20 +566,6 @@ For more information, see: ${link("https://pris.ly/prisma-config")}
855
566
  `))
856
567
  });
857
568
  const prismaConfig = transformPathsInConfigToAbsolute(parsedConfig, resolvedPath);
858
- if (deprecatedPrismaConfigFromJson) {
859
- diagnostics.push({
860
- _tag: "warn",
861
- value: ({ warn, link }) => () => warn(`The Prisma config file in ${import_node_path.default.relative(
862
- configRoot,
863
- resolvedPath
864
- )} overrides the deprecated \`package.json#prisma\` property in ${import_node_path.default.relative(
865
- configRoot,
866
- deprecatedPrismaConfigFromJson.loadedFromFile
867
- )}.
868
- For more information, see: ${link("https://pris.ly/prisma-config")}
869
- `)
870
- });
871
- }
872
569
  return {
873
570
  config: {
874
571
  ...prismaConfig,
@@ -924,7 +621,7 @@ async function loadConfigTsOrJs(configRoot, configFile) {
924
621
  const resolvedPath = _resolvedPath ? import_node_path.default.normalize(_resolvedPath) : void 0;
925
622
  const doesConfigFileExist = resolvedPath !== void 0 && meta !== void 0;
926
623
  if (configFile && !doesConfigFileExist) {
927
- debug4(`The given config file was not found at %s`, resolvedPath);
624
+ debug3(`The given config file was not found at %s`, resolvedPath);
928
625
  return {
929
626
  require: null,
930
627
  resolvedPath: import_node_path.default.join(configRoot, configFile),
@@ -951,11 +648,11 @@ async function loadConfigTsOrJs(configRoot, configFile) {
951
648
  };
952
649
  } catch (e) {
953
650
  const error = e;
954
- debug4("jiti import failed: %s", error.message);
651
+ debug3("jiti import failed: %s", error.message);
955
652
  const configFileMatch = error.message.match(/prisma\.config\.(\w+)/);
956
653
  const extension = configFileMatch?.[1];
957
654
  const filenameWithExtension = import_node_path.default.join(configRoot, extension ? `prisma.config.${extension}` : "");
958
- debug4("faulty config file: %s", filenameWithExtension);
655
+ debug3("faulty config file: %s", filenameWithExtension);
959
656
  return {
960
657
  error: {
961
658
  _tag: "ConfigLoadError",
@@ -995,6 +692,5 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
995
692
  defaultTestConfig,
996
693
  defineConfig,
997
694
  env,
998
- loadConfigFromFile,
999
- loadConfigFromPackageJson
695
+ loadConfigFromFile
1000
696
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/config",
3
- "version": "7.3.0-integration-prisma6-fix-cloudflare-engine.2",
3
+ "version": "7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1",
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",
@@ -18,9 +18,10 @@
18
18
  "empathic": "2.0.0"
19
19
  },
20
20
  "devDependencies": {
21
+ "dotenv": "17.2.3",
21
22
  "vitest": "3.2.4",
22
- "@prisma/driver-adapter-utils": "7.3.0-integration-prisma6-fix-cloudflare-engine.2",
23
- "@prisma/get-platform": "7.3.0-integration-prisma6-fix-cloudflare-engine.2"
23
+ "@prisma/debug": "7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1",
24
+ "@prisma/get-platform": "7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1"
24
25
  },
25
26
  "files": [
26
27
  "dist"