@prisma/config 6.13.0-dev.19 → 6.13.0-dev.20

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 +91 -0
  2. package/dist/index.js +275 -22586
  3. package/package.json +6 -5
package/dist/index.d.ts CHANGED
@@ -51,18 +51,29 @@ declare const ColumnTypeEnum: {
51
51
  readonly UnknownNumber: 128;
52
52
  };
53
53
 
54
+ export declare type ConfigDiagnostic = {
55
+ _tag: 'log';
56
+ value: (formatters: InjectFormatters) => () => void;
57
+ } | {
58
+ _tag: 'warn';
59
+ value: (formatters: InjectFormatters) => () => void;
60
+ };
61
+
54
62
  export declare type ConfigFromFile = {
55
63
  resolvedPath: string;
56
64
  config: PrismaConfigInternal;
57
65
  error?: never;
66
+ diagnostics: ConfigDiagnostic[];
58
67
  } | {
59
68
  resolvedPath: string;
60
69
  config?: never;
61
70
  error: LoadConfigFromFileError;
71
+ diagnostics: ConfigDiagnostic[];
62
72
  } | {
63
73
  resolvedPath: null;
64
74
  config: PrismaConfigInternal;
65
75
  error?: never;
76
+ diagnostics: ConfigDiagnostic[];
66
77
  };
67
78
 
68
79
  declare type ConnectionInfo = {
@@ -92,6 +103,15 @@ declare interface DriverAdapterFactory<Query, Result> extends AdapterInfo {
92
103
  connect(): Promise<Queryable<Query, Result>>;
93
104
  }
94
105
 
106
+ declare type EnumsConfigShape = {
107
+ /**
108
+ * List of enums that are externally managed.
109
+ * Prisma will not modify the structure of these enums and not generate migrations for those enums.
110
+ * These enums will still be represented in schema.prisma file and be available in the client API.
111
+ */
112
+ external?: string[];
113
+ };
114
+
95
115
  declare type Error_2 = {
96
116
  kind: 'GenericJs';
97
117
  id: number;
@@ -131,6 +151,10 @@ declare type Error_2 = {
131
151
  } | {
132
152
  foreignKey: {};
133
153
  };
154
+ } | {
155
+ kind: 'DatabaseNotReachable';
156
+ host?: string;
157
+ port?: number;
134
158
  } | {
135
159
  kind: 'DatabaseDoesNotExist';
136
160
  db?: string;
@@ -140,6 +164,11 @@ declare type Error_2 = {
140
164
  } | {
141
165
  kind: 'DatabaseAccessDenied';
142
166
  db?: string;
167
+ } | {
168
+ kind: 'ConnectionClosed';
169
+ } | {
170
+ kind: 'TlsConnectionError';
171
+ reason: string;
143
172
  } | {
144
173
  kind: 'AuthenticationFailed';
145
174
  user?: string;
@@ -226,6 +255,13 @@ declare type ExperimentalConfig = {
226
255
  externalTables?: boolean;
227
256
  };
228
257
 
258
+ export declare type InjectFormatters = {
259
+ dim: (data: string) => string;
260
+ log: (data: string) => void;
261
+ warn: (data: string) => void;
262
+ link: (data: string) => string;
263
+ };
264
+
229
265
  declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE';
230
266
 
231
267
  /**
@@ -262,6 +298,20 @@ declare type LoadConfigFromFileInput = {
262
298
  configRoot?: string;
263
299
  };
264
300
 
301
+ /**
302
+ * User's Prisma configuration should live in `prisma.config.ts` instead of `package.json#prisma`.
303
+ * See: https://pris.ly/prisma-config.
304
+ *
305
+ * This function returns `null` if no `package.json` is found, or if the `prisma` property is not defined therein.
306
+ *
307
+ * TODO: remove in Prisma 7.
308
+ * @deprecated
309
+ */
310
+ export declare function loadConfigFromPackageJson(cwd?: string): Promise<{
311
+ config: PrismaConfigPackageJson;
312
+ loadedFromFile: string;
313
+ } | null>;
314
+
265
315
  declare type MigrationsConfigShape = {
266
316
  /**
267
317
  * The path to the directory where Prisma should store migration files, and look for them.
@@ -272,6 +322,10 @@ declare type MigrationsConfigShape = {
272
322
  * Also see `tables.external`.
273
323
  */
274
324
  setupExternalTables?: string;
325
+ /**
326
+ * The command to run to seed the database after schema migrations are applied.
327
+ */
328
+ seed?: string;
275
329
  };
276
330
 
277
331
  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"];
@@ -307,6 +361,10 @@ export declare type PrismaConfig = {
307
361
  * Configuration for the database table entities.
308
362
  */
309
363
  tables?: Simplify<TablesConfigShape>;
364
+ /**
365
+ * Configuration for the database enum entities.
366
+ */
367
+ enums?: Simplify<EnumsConfigShape>;
310
368
  /**
311
369
  * Configuration for the database view entities.
312
370
  */
@@ -336,6 +394,39 @@ declare type _PrismaConfigInternal = Omit<PrismaConfig, 'adapter'> & {
336
394
  * It's set to `null` if no config file was found and only default config is applied.
337
395
  */
338
396
  loadedFromFile: string | null;
397
+ /**
398
+ * The deprecated Prisma configuration from `package.json#prisma`.
399
+ * This is set to `null` if no `package.json#prisma` config was found.
400
+ * The configuration read from the Prisma config file (e.g., `prisma.config.ts`) takes precedence over
401
+ * this `package.json#prisma` config.
402
+ * @deprecated
403
+ */
404
+ deprecatedPackageJson: {
405
+ /**
406
+ * The Prisma configuration from `package.json#prisma`.
407
+ * @deprecated
408
+ */
409
+ config: PrismaConfigPackageJson;
410
+ /**
411
+ * The path from where the `package.json` config was loaded.
412
+ * @deprecated
413
+ */
414
+ loadedFromFile: string;
415
+ } | null;
416
+ };
417
+
418
+ /**
419
+ * Example:
420
+ * ```json
421
+ * {
422
+ * "schema": "./prisma/schema.prisma",
423
+ * "seed": "tsx ./prisma/seed.ts"
424
+ * }
425
+ * ```
426
+ */
427
+ declare type PrismaConfigPackageJson = {
428
+ schema?: string;
429
+ seed?: string;
339
430
  };
340
431
 
341
432
  declare type PrismaStudioConfigShape = {