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

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 +37 -50
  2. package/dist/index.js +1238 -1575
  3. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import type { Simplify } from 'effect/Types';
2
-
3
1
  /**
4
2
  * An interface that exposes some basic information about the
5
3
  * adapter like its name and provider type.
@@ -55,7 +53,7 @@ declare const ColumnTypeEnum: {
55
53
 
56
54
  export declare type ConfigFromFile = {
57
55
  resolvedPath: string;
58
- config: PrismaConfigInternal;
56
+ config: PrismaConfigInternal<any>;
59
57
  error?: never;
60
58
  } | {
61
59
  resolvedPath: string;
@@ -63,7 +61,7 @@ export declare type ConfigFromFile = {
63
61
  error: LoadConfigFromFileError;
64
62
  } | {
65
63
  resolvedPath: null;
66
- config: PrismaConfigInternal;
64
+ config: PrismaConfigInternal<any>;
67
65
  error?: never;
68
66
  };
69
67
 
@@ -76,12 +74,12 @@ declare type ConnectionInfo = {
76
74
  /**
77
75
  * This default config can be used as basis for unit and integration tests.
78
76
  */
79
- export declare function defaultTestConfig(): PrismaConfigInternal;
77
+ export declare function defaultTestConfig<Env extends Record<string, string | undefined> = never>(): PrismaConfigInternal<Env>;
80
78
 
81
79
  /**
82
80
  * Define the configuration for the Prisma Development Kit.
83
81
  */
84
- export declare function defineConfig(configInput: PrismaConfig): PrismaConfigInternal;
82
+ export declare function defineConfig<Env extends Record<string, string | undefined> = never>(configInput: PrismaConfig<Env>): PrismaConfigInternal<Env>;
85
83
 
86
84
  /**
87
85
  * A generic driver adapter factory that allows the user to instantiate a
@@ -94,6 +92,8 @@ declare interface DriverAdapterFactory<Query, Result> extends AdapterInfo {
94
92
  connect(): Promise<Queryable<Query, Result>>;
95
93
  }
96
94
 
95
+ declare type EnvVars = Record<string, string | undefined>;
96
+
97
97
  declare type Error_2 = {
98
98
  kind: 'GenericJs';
99
99
  id: number;
@@ -246,13 +246,6 @@ declare type LoadConfigFromFileInput = {
246
246
  configRoot?: string;
247
247
  };
248
248
 
249
- declare type MigrationsConfigShape = {
250
- /**
251
- * The path to the directory where Prisma should store migration files, and look for them.
252
- */
253
- path?: string;
254
- };
255
-
256
249
  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"];
257
250
 
258
251
  declare const PRISMA_CONFIG_INTERNAL_BRAND: unique symbol;
@@ -261,35 +254,23 @@ declare const PRISMA_CONFIG_INTERNAL_BRAND: unique symbol;
261
254
  * The configuration for the Prisma Development Kit, before it is passed to the `defineConfig` function.
262
255
  * Thanks to the branding, this type is opaque and cannot be constructed directly.
263
256
  */
264
- export declare type PrismaConfig = {
257
+ export declare type PrismaConfig<Env extends EnvVars = never> = {
265
258
  /**
266
259
  * Whether features with an unstable API are enabled.
267
260
  */
268
261
  earlyAccess: true;
269
262
  /**
270
- * The path to the schema file, or path to a folder that shall be recursively searched for *.prisma files.
263
+ * The path to the schema file or path to a folder that shall be recursively searched for .prisma files.
271
264
  */
272
265
  schema?: string;
273
- /**
274
- * The Driver Adapter used for Prisma CLI.
275
- */
276
- adapter?: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
277
266
  /**
278
267
  * The configuration for Prisma Studio.
279
268
  */
280
- studio?: Simplify<PrismaStudioConfigShape>;
269
+ studio?: PrismaStudioConfigShape<Env>;
281
270
  /**
282
- * Configuration for Prisma migrations.
271
+ * The configuration for Prisma Migrate + Introspect
283
272
  */
284
- migrations?: Simplify<MigrationsConfigShape>;
285
- /**
286
- * Configuration for the database view entities.
287
- */
288
- views?: Simplify<ViewsConfigShape>;
289
- /**
290
- * Configuration for the `typedSql` preview feature.
291
- */
292
- typedSql?: Simplify<TypedSqlConfigShape>;
273
+ migrate?: PrismaMigrateConfigShape<Env>;
293
274
  };
294
275
 
295
276
  /**
@@ -297,15 +278,27 @@ export declare type PrismaConfig = {
297
278
  * by the `defineConfig` function.
298
279
  * Thanks to the branding, this type is opaque and cannot be constructed directly.
299
280
  */
300
- export declare type PrismaConfigInternal = _PrismaConfigInternal & {
281
+ export declare type PrismaConfigInternal<Env extends EnvVars = never> = _PrismaConfigInternal<Env> & {
301
282
  __brand: typeof PRISMA_CONFIG_INTERNAL_BRAND;
302
283
  };
303
284
 
304
- declare type _PrismaConfigInternal = Omit<PrismaConfig, 'adapter'> & {
285
+ declare type _PrismaConfigInternal<Env extends EnvVars = never> = {
286
+ /**
287
+ * Whether features with an unstable API are enabled.
288
+ */
289
+ earlyAccess: true;
290
+ /**
291
+ * The path to the schema file or path to a folder that shall be recursively searched for .prisma files.
292
+ */
293
+ schema?: string;
294
+ /**
295
+ * The configuration for Prisma Studio.
296
+ */
297
+ studio?: PrismaStudioConfigShape<Env>;
305
298
  /**
306
- * The Driver Adapter used for Prisma CLI.
299
+ * The configuration for Prisma Migrate + Introspect
307
300
  */
308
- adapter?: () => Promise<ErrorCapturingSqlMigrationAwareDriverAdapterFactory>;
301
+ migrate?: PrismaMigrateConfigInternalShape<Env>;
309
302
  /**
310
303
  * The path from where the config was loaded.
311
304
  * It's set to `null` if no config file was found and only default config is applied.
@@ -313,8 +306,16 @@ declare type _PrismaConfigInternal = Omit<PrismaConfig, 'adapter'> & {
313
306
  loadedFromFile: string | null;
314
307
  };
315
308
 
316
- declare type PrismaStudioConfigShape = {
317
- adapter: () => Promise<SqlMigrationAwareDriverAdapterFactory>;
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>;
318
319
  };
319
320
 
320
321
  declare type Provider = 'mysql' | 'postgres' | 'sqlite' | 'sqlserver';
@@ -422,18 +423,4 @@ declare type TransactionOptions = {
422
423
  usePhantomQuery: boolean;
423
424
  };
424
425
 
425
- declare type TypedSqlConfigShape = {
426
- /**
427
- * The path to the directory where Prisma should look for the `typedSql` queries, where *.sql files will be loaded.
428
- */
429
- path?: string;
430
- };
431
-
432
- declare type ViewsConfigShape = {
433
- /**
434
- * The path to the directory where Prisma should look for the view definitions, where *.sql files will be loaded.
435
- */
436
- path?: string;
437
- };
438
-
439
426
  export { }