@prisma/config 6.20.0-integration-aqrln-wpvsvmvvnylq.1 → 6.20.0-integration-next.10

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
@@ -1,59 +1,3 @@
1
- /**
2
- * An interface that exposes some basic information about the
3
- * adapter like its name and provider type.
4
- */
5
- declare interface AdapterInfo {
6
- readonly provider: Provider;
7
- readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {});
8
- }
9
-
10
- declare type ArgScalarType = 'string' | 'int' | 'bigint' | 'float' | 'decimal' | 'boolean' | 'enum' | 'uuid' | 'json' | 'datetime' | 'bytes' | 'unknown';
11
-
12
- declare type ArgType = {
13
- scalarType: ArgScalarType;
14
- dbType?: string;
15
- arity: Arity;
16
- };
17
-
18
- declare type Arity = 'scalar' | 'list';
19
-
20
- declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum];
21
-
22
- declare const ColumnTypeEnum: {
23
- readonly Int32: 0;
24
- readonly Int64: 1;
25
- readonly Float: 2;
26
- readonly Double: 3;
27
- readonly Numeric: 4;
28
- readonly Boolean: 5;
29
- readonly Character: 6;
30
- readonly Text: 7;
31
- readonly Date: 8;
32
- readonly Time: 9;
33
- readonly DateTime: 10;
34
- readonly Json: 11;
35
- readonly Enum: 12;
36
- readonly Bytes: 13;
37
- readonly Set: 14;
38
- readonly Uuid: 15;
39
- readonly Int32Array: 64;
40
- readonly Int64Array: 65;
41
- readonly FloatArray: 66;
42
- readonly DoubleArray: 67;
43
- readonly NumericArray: 68;
44
- readonly BooleanArray: 69;
45
- readonly CharacterArray: 70;
46
- readonly TextArray: 71;
47
- readonly DateArray: 72;
48
- readonly TimeArray: 73;
49
- readonly DateTimeArray: 74;
50
- readonly JsonArray: 75;
51
- readonly EnumArray: 76;
52
- readonly BytesArray: 77;
53
- readonly UuidArray: 78;
54
- readonly UnknownNumber: 128;
55
- };
56
-
57
1
  export declare type ConfigDiagnostic = {
58
2
  _tag: 'log';
59
3
  value: (formatters: InjectFormatters) => () => void;
@@ -79,12 +23,6 @@ export declare type ConfigFromFile = {
79
23
  diagnostics: ConfigDiagnostic[];
80
24
  };
81
25
 
82
- declare type ConnectionInfo = {
83
- schemaName?: string;
84
- maxBindValues?: number;
85
- supportsRelationJoins: boolean;
86
- };
87
-
88
26
  export declare type Datasource = {
89
27
  url: string;
90
28
  shadowDatabaseUrl?: string;
@@ -100,17 +38,6 @@ export declare function defaultTestConfig(): PrismaConfigInternal;
100
38
  */
101
39
  export declare function defineConfig(configInput: PrismaConfig): PrismaConfigInternal;
102
40
 
103
- /**
104
- * A generic driver adapter factory that allows the user to instantiate a
105
- * driver adapter. The query and result types are specific to the adapter.
106
- */
107
- declare interface DriverAdapterFactory<Query, Result> extends AdapterInfo {
108
- /**
109
- * Instantiate a driver adapter.
110
- */
111
- connect(): Promise<Queryable<Query, Result>>;
112
- }
113
-
114
41
  declare type EnumsConfigShape = {
115
42
  /**
116
43
  * List of enums that are externally managed.
@@ -123,10 +50,6 @@ declare type EnumsConfigShape = {
123
50
  export declare function env<Env extends Record<string, string | undefined>>(name: keyof Env & string): string;
124
51
 
125
52
  declare type ExperimentalConfig = {
126
- /**
127
- * Enable experimental Prisma Studio features.
128
- */
129
- studio?: boolean;
130
53
  /**
131
54
  * Enable experimental external tables support.
132
55
  */
@@ -144,8 +67,6 @@ export declare type InjectFormatters = {
144
67
  link: (data: string) => string;
145
68
  };
146
69
 
147
- declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE';
148
-
149
70
  /**
150
71
  * Load a Prisma config file from the given directory.
151
72
  * This function may fail, but it will never throw.
@@ -196,8 +117,6 @@ declare type MigrationsConfigShape = {
196
117
  seed?: string;
197
118
  };
198
119
 
199
- 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"];
200
-
201
120
  declare const PRISMA_CONFIG_INTERNAL_BRAND: unique symbol;
202
121
 
203
122
  /**
@@ -217,10 +136,6 @@ export declare type PrismaConfig = {
217
136
  * The path to the schema file, or path to a folder that shall be recursively searched for *.prisma files.
218
137
  */
219
138
  schema?: string;
220
- /**
221
- * The configuration for Prisma Studio.
222
- */
223
- studio?: Simplify<PrismaStudioConfigShape>;
224
139
  /**
225
140
  * Configuration for Prisma migrations.
226
141
  */
@@ -260,23 +175,6 @@ declare type _PrismaConfigInternal = PrismaConfig & {
260
175
  loadedFromFile: string | null;
261
176
  };
262
177
 
263
- declare type PrismaStudioConfigShape = {
264
- adapter: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
265
- };
266
-
267
- declare type Provider = 'mysql' | 'postgres' | 'sqlite' | 'sqlserver';
268
-
269
- declare interface Queryable<Query, Result> extends AdapterInfo {
270
- /**
271
- * Execute a query and return its result.
272
- */
273
- queryRaw(params: Query): Promise<Result>;
274
- /**
275
- * Execute a query and return the number of affected rows.
276
- */
277
- executeRaw(params: Query): Promise<number>;
278
- }
279
-
280
178
  export declare type SchemaEngineConfigInternal = {
281
179
  datasource?: Datasource;
282
180
  };
@@ -294,68 +192,6 @@ declare type Simplify<A> = {
294
192
  [K in keyof A]: A[K];
295
193
  } extends infer B ? B : never;
296
194
 
297
- declare interface SqlDriverAdapter extends SqlQueryable {
298
- /**
299
- * Execute multiple SQL statements separated by semicolon.
300
- */
301
- executeScript(script: string): Promise<void>;
302
- /**
303
- * Start new transaction.
304
- */
305
- startTransaction(isolationLevel?: IsolationLevel): Promise<Transaction>;
306
- /**
307
- * Optional method that returns extra connection info
308
- */
309
- getConnectionInfo?(): ConnectionInfo;
310
- /**
311
- * Dispose of the connection and release any resources.
312
- */
313
- dispose(): Promise<void>;
314
- }
315
-
316
- declare interface SqlDriverAdapterFactory extends DriverAdapterFactory<SqlQuery, SqlResultSet> {
317
- connect(): Promise<SqlDriverAdapter>;
318
- }
319
-
320
- /**
321
- * An SQL migration adapter that is aware of the notion of a shadow database
322
- * and can create a connection to it.
323
- */
324
- declare interface SqlMigrationAwareDriverAdapterFactory extends SqlDriverAdapterFactory {
325
- connectToShadowDb(): Promise<SqlDriverAdapter>;
326
- }
327
-
328
- declare type SqlQuery = {
329
- sql: string;
330
- args: Array<unknown>;
331
- argTypes: Array<ArgType>;
332
- };
333
-
334
- declare interface SqlQueryable extends Queryable<SqlQuery, SqlResultSet> {
335
- }
336
-
337
- declare interface SqlResultSet {
338
- /**
339
- * List of column types appearing in a database query, in the same order as `columnNames`.
340
- * They are used within the Query Engine to convert values from JS to Quaint values.
341
- */
342
- columnTypes: Array<ColumnType>;
343
- /**
344
- * List of column names appearing in a database query, in the same order as `columnTypes`.
345
- */
346
- columnNames: Array<string>;
347
- /**
348
- * List of rows retrieved from a database query.
349
- * Each row is a list of values, whose length matches `columnNames` and `columnTypes`.
350
- */
351
- rows: Array<Array<unknown>>;
352
- /**
353
- * The last ID of an `INSERT` statement, if any.
354
- * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite.
355
- */
356
- lastInsertId?: string;
357
- }
358
-
359
195
  declare type TablesConfigShape = {
360
196
  /**
361
197
  * List of tables that are externally managed.
@@ -365,25 +201,6 @@ declare type TablesConfigShape = {
365
201
  external?: string[];
366
202
  };
367
203
 
368
- declare interface Transaction extends AdapterInfo, SqlQueryable {
369
- /**
370
- * Transaction options.
371
- */
372
- readonly options: TransactionOptions;
373
- /**
374
- * Commit the transaction.
375
- */
376
- commit(): Promise<void>;
377
- /**
378
- * Roll back the transaction.
379
- */
380
- rollback(): Promise<void>;
381
- }
382
-
383
- declare type TransactionOptions = {
384
- usePhantomQuery: boolean;
385
- };
386
-
387
204
  declare type TypedSqlConfigShape = {
388
205
  /**
389
206
  * The path to the directory where Prisma should look for the `typedSql` queries, where *.sql files will be loaded.
package/dist/index.js CHANGED
@@ -224,16 +224,6 @@ function safeStringify(value, indent = 2) {
224
224
  );
225
225
  }
226
226
 
227
- // ../driver-adapter-utils/dist/index.mjs
228
- var debug = Debug("driver-adapter-utils");
229
- var mockAdapterErrors = {
230
- queryRaw: new Error("Not implemented: queryRaw"),
231
- executeRaw: new Error("Not implemented: executeRaw"),
232
- startTransaction: new Error("Not implemented: startTransaction"),
233
- executeScript: new Error("Not implemented: executeScript"),
234
- dispose: new Error("Not implemented: dispose")
235
- };
236
-
237
227
  // src/PrismaConfig.ts
238
228
  var import_effect2 = require("effect");
239
229
  var import_Function = require("effect/Function");
@@ -251,9 +241,6 @@ function defaultConfig() {
251
241
  // src/defineConfig.ts
252
242
  function validateExperimentalFeatures(config) {
253
243
  const experimental = config.experimental || {};
254
- if (config.studio && !experimental.studio) {
255
- return import_effect.Either.left(new Error("The `studio` configuration requires `experimental.studio` to be set to `true`."));
256
- }
257
244
  if (config.tables?.external && !experimental.externalTables) {
258
245
  return import_effect.Either.left(
259
246
  new Error("The `tables.external` configuration requires `experimental.externalTables` to be set to `true`.")
@@ -273,18 +260,17 @@ function validateExperimentalFeatures(config) {
273
260
  }
274
261
  return import_effect.Either.right(config);
275
262
  }
276
- var debug2 = Debug("prisma:config:defineConfig");
263
+ var debug = Debug("prisma:config:defineConfig");
277
264
  function defineConfig(configInput) {
278
265
  const validationResult = validateExperimentalFeatures(configInput);
279
266
  if (validationResult._tag === "Left") {
280
267
  throw validationResult.left;
281
268
  }
282
269
  const config = defaultConfig();
283
- debug2("[default]: %o", config);
270
+ debug("[default]: %o", config);
284
271
  defineExperimentalConfig(config, configInput);
285
272
  defineSchemaConfig(config, configInput);
286
273
  defineDatasource(config, configInput);
287
- defineStudioConfig(config, configInput);
288
274
  defineMigrationsConfig(config, configInput);
289
275
  defineTablesConfig(config, configInput);
290
276
  defineEnumsConfig(config, configInput);
@@ -298,95 +284,70 @@ function defineExperimentalConfig(config, configInput) {
298
284
  return;
299
285
  }
300
286
  config.experimental = configInput.experimental;
301
- debug2("[config.experimental]: %o", config.experimental);
287
+ debug("[config.experimental]: %o", config.experimental);
302
288
  }
303
289
  function defineSchemaConfig(config, configInput) {
304
290
  if (!configInput.schema) {
305
291
  return;
306
292
  }
307
293
  config.schema = configInput.schema;
308
- debug2("[config.schema]: %o", config.schema);
294
+ debug("[config.schema]: %o", config.schema);
309
295
  }
310
296
  function defineMigrationsConfig(config, configInput) {
311
297
  if (!configInput.migrations) {
312
298
  return;
313
299
  }
314
300
  config.migrations = configInput.migrations;
315
- debug2("[config.migrations]: %o", config.migrations);
301
+ debug("[config.migrations]: %o", config.migrations);
316
302
  }
317
303
  function defineTypedSqlConfig(config, configInput) {
318
304
  if (!configInput.typedSql) {
319
305
  return;
320
306
  }
321
307
  config.typedSql = configInput.typedSql;
322
- debug2("[config.typedSql]: %o", config.typedSql);
308
+ debug("[config.typedSql]: %o", config.typedSql);
323
309
  }
324
310
  function defineViewsConfig(config, configInput) {
325
311
  if (!configInput.views) {
326
312
  return;
327
313
  }
328
314
  config.views = configInput.views;
329
- debug2("[config.views]: %o", config.views);
315
+ debug("[config.views]: %o", config.views);
330
316
  }
331
317
  function defineTablesConfig(config, configInput) {
332
318
  if (!configInput.tables) {
333
319
  return;
334
320
  }
335
321
  config.tables = configInput.tables;
336
- debug2("[config.tables]: %o", config.tables);
322
+ debug("[config.tables]: %o", config.tables);
337
323
  }
338
324
  function defineEnumsConfig(config, configInput) {
339
325
  if (!configInput.enums) {
340
326
  return;
341
327
  }
342
328
  config.enums = configInput.enums;
343
- debug2("[config.enums]: %o", config.enums);
344
- }
345
- function defineStudioConfig(config, configInput) {
346
- if (!configInput.studio?.adapter) {
347
- return;
348
- }
349
- const { adapter: getAdapterFactory } = configInput.studio;
350
- config.studio = {
351
- adapter: async () => {
352
- const adapterFactory = await getAdapterFactory();
353
- debug2("[config.studio.adapter]: %o", adapterFactory.adapterName);
354
- return adapterFactory;
355
- }
356
- };
357
- debug2("[config.studio]: %o", config.studio);
329
+ debug("[config.enums]: %o", config.enums);
358
330
  }
359
331
  function defineDatasource(config, configInput) {
360
332
  const { datasource } = configInput;
361
333
  Object.assign(config, { datasource });
362
- debug2("[config.datasource]: %o", datasource);
334
+ debug("[config.datasource]: %o", datasource);
363
335
  }
364
336
  function defineExtensionsConfig(config, configInput) {
365
337
  if (!configInput["extensions"]) {
366
338
  return;
367
339
  }
368
340
  config["extensions"] = configInput["extensions"];
369
- debug2("[config.extensions]: %o", config["extensions"]);
341
+ debug("[config.extensions]: %o", config["extensions"]);
370
342
  }
371
343
 
372
344
  // src/PrismaConfig.ts
373
- var debug3 = Debug("prisma:config:PrismaConfig");
374
- var SqlMigrationAwareDriverAdapterFactoryShape = import_effect2.Schema.declare(
375
- (input) => {
376
- return typeof input === "function";
377
- },
378
- {
379
- identifier: "SqlMigrationAwareDriverAdapterFactory",
380
- encode: import_effect2.identity,
381
- decode: import_effect2.identity
382
- }
383
- );
345
+ var debug2 = Debug("prisma:config:PrismaConfig");
384
346
  var DatasourceShape = import_effect2.Schema.Struct({
385
347
  url: import_effect2.Schema.String,
386
348
  shadowDatabaseUrl: import_effect2.Schema.optional(import_effect2.Schema.String)
387
349
  });
388
350
  var ExperimentalConfigShape = import_effect2.Schema.Struct({
389
- studio: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
390
351
  externalTables: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
391
352
  extensions: import_effect2.Schema.optional(import_effect2.Schema.Boolean)
392
353
  });
@@ -431,16 +392,6 @@ if (false) {
431
392
  __testTypedSqlConfigShapeValueA;
432
393
  __testTypedSqlConfigShapeValueB;
433
394
  }
434
- var PrismaStudioConfigShape = import_effect2.Schema.Struct({
435
- /**
436
- * Instantiates the Prisma driver adapter to use for Prisma Studio.
437
- */
438
- adapter: SqlMigrationAwareDriverAdapterFactoryShape
439
- });
440
- if (false) {
441
- __testPrismaStudioConfigShapeValueA;
442
- __testPrismaStudioConfigShapeValueB;
443
- }
444
395
  if (false) {
445
396
  __testPrismaConfig;
446
397
  __testPrismaConfigInternal;
@@ -449,7 +400,6 @@ var PrismaConfigShape = import_effect2.Schema.Struct({
449
400
  experimental: import_effect2.Schema.optional(ExperimentalConfigShape),
450
401
  datasource: import_effect2.Schema.optional(DatasourceShape),
451
402
  schema: import_effect2.Schema.optional(import_effect2.Schema.String),
452
- studio: import_effect2.Schema.optional(PrismaStudioConfigShape),
453
403
  migrations: import_effect2.Schema.optional(MigrationsConfigShape),
454
404
  tables: import_effect2.Schema.optional(TablesConfigShape),
455
405
  enums: import_effect2.Schema.optional(EnumsConfigShape),
@@ -463,9 +413,6 @@ if (false) {
463
413
  }
464
414
  function validateExperimentalFeatures2(config) {
465
415
  const experimental = config.experimental || {};
466
- if (config.studio && !experimental.studio) {
467
- return import_effect2.Either.left(new Error("The `studio` configuration requires `experimental.studio` to be set to `true`."));
468
- }
469
416
  if (config.tables?.external && !experimental.externalTables) {
470
417
  return import_effect2.Either.left(
471
418
  new Error("The `tables.external` configuration requires `experimental.externalTables` to be set to `true`.")
@@ -513,9 +460,9 @@ function brandPrismaConfigInternal(config) {
513
460
  return config;
514
461
  }
515
462
  function parsePrismaConfigInternalShape(input) {
516
- debug3("Parsing PrismaConfigInternal: %o", input);
463
+ debug2("Parsing PrismaConfigInternal: %o", input);
517
464
  if (typeof input === "object" && input !== null && input["__brand"] === PRISMA_CONFIG_INTERNAL_BRAND) {
518
- debug3("Short-circuit: input is already a PrismaConfigInternal object");
465
+ debug2("Short-circuit: input is already a PrismaConfigInternal object");
519
466
  return import_effect2.Either.right(input);
520
467
  }
521
468
  return (0, import_Function.pipe)(
@@ -539,7 +486,7 @@ function parseDefaultExport(defaultExport) {
539
486
  // If the given config conforms to the `PrismaConfig` shape, feed it to `defineConfig`.
540
487
  parsePrismaConfigShape(defaultExport),
541
488
  import_effect2.Either.map((config) => {
542
- debug3("Parsed `PrismaConfig` shape: %o", config);
489
+ debug2("Parsed `PrismaConfig` shape: %o", config);
543
490
  return defineConfig(config);
544
491
  }),
545
492
  // Otherwise, try to parse it as a `PrismaConfigInternal` shape.
@@ -576,7 +523,7 @@ function env(name) {
576
523
  // src/loadConfigFromFile.ts
577
524
  var import_node_path = __toESM(require("node:path"));
578
525
  var import_node_process = __toESM(require("node:process"));
579
- var debug4 = Debug("prisma:config:loadConfigFromFile");
526
+ var debug3 = Debug("prisma:config:loadConfigFromFile");
580
527
  var SUPPORTED_EXTENSIONS = [".js", ".ts", ".mjs", ".cjs", ".mts", ".cts"];
581
528
  async function loadConfigFromFile({
582
529
  configFile,
@@ -594,9 +541,9 @@ async function loadConfigFromFile({
594
541
  diagnostics
595
542
  };
596
543
  }
597
- debug4(`Config file loaded in %s`, getTime());
544
+ debug3(`Config file loaded in %s`, getTime());
598
545
  if (resolvedPath === null) {
599
- 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);
600
547
  return { resolvedPath: null, config: defaultConfig(), diagnostics };
601
548
  }
602
549
  let parsedConfig;
@@ -674,7 +621,7 @@ async function loadConfigTsOrJs(configRoot, configFile) {
674
621
  const resolvedPath = _resolvedPath ? import_node_path.default.normalize(_resolvedPath) : void 0;
675
622
  const doesConfigFileExist = resolvedPath !== void 0 && meta !== void 0;
676
623
  if (configFile && !doesConfigFileExist) {
677
- debug4(`The given config file was not found at %s`, resolvedPath);
624
+ debug3(`The given config file was not found at %s`, resolvedPath);
678
625
  return {
679
626
  require: null,
680
627
  resolvedPath: import_node_path.default.join(configRoot, configFile),
@@ -701,11 +648,11 @@ async function loadConfigTsOrJs(configRoot, configFile) {
701
648
  };
702
649
  } catch (e) {
703
650
  const error = e;
704
- debug4("jiti import failed: %s", error.message);
651
+ debug3("jiti import failed: %s", error.message);
705
652
  const configFileMatch = error.message.match(/prisma\.config\.(\w+)/);
706
653
  const extension = configFileMatch?.[1];
707
654
  const filenameWithExtension = import_node_path.default.join(configRoot, extension ? `prisma.config.${extension}` : "");
708
- debug4("faulty config file: %s", filenameWithExtension);
655
+ debug3("faulty config file: %s", filenameWithExtension);
709
656
  return {
710
657
  error: {
711
658
  _tag: "ConfigLoadError",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/config",
3
- "version": "6.20.0-integration-aqrln-wpvsvmvvnylq.1",
3
+ "version": "6.20.0-integration-next.10",
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",
@@ -20,8 +20,8 @@
20
20
  "devDependencies": {
21
21
  "dotenv": "17.2.3",
22
22
  "vitest": "3.2.4",
23
- "@prisma/driver-adapter-utils": "6.20.0-integration-aqrln-wpvsvmvvnylq.1",
24
- "@prisma/get-platform": "6.20.0-integration-aqrln-wpvsvmvvnylq.1"
23
+ "@prisma/debug": "6.20.0-integration-next.10",
24
+ "@prisma/get-platform": "6.20.0-integration-next.10"
25
25
  },
26
26
  "files": [
27
27
  "dist"