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

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