MCPcopy
hub / github.com/prisma/prisma / validateExperimentalFeatures

Function validateExperimentalFeatures

packages/config/src/defineConfig.ts:11–37  ·  view source on GitHub ↗

* Validates that experimental features are enabled when using corresponding configuration options.

(config: PrismaConfig)

Source from the content-addressed store, hash-verified

9 * Validates that experimental features are enabled when using corresponding configuration options.
10 */
11function validateExperimentalFeatures(config: PrismaConfig): Either.Either<PrismaConfig, Error> {
12 const experimental = config.experimental || {}
13
14 // Check external tables configuration
15 if (config.tables?.external && !experimental.externalTables) {
16 return Either.left(
17 new Error('The `tables.external` configuration requires `experimental.externalTables` to be set to `true`.'),
18 )
19 }
20
21 // Check migrations initShadowDb configuration
22 if (config.migrations?.initShadowDb && !experimental.externalTables) {
23 return Either.left(
24 new Error(
25 'The `migrations.initShadowDb` configuration requires `experimental.externalTables` to be set to `true`.',
26 ),
27 )
28 }
29
30 if (config['extensions'] !== undefined && !experimental.extensions) {
31 return Either.left(
32 new Error('The `extensions` configuration requires `experimental.extensions` to be set to `true`.'),
33 )
34 }
35
36 return Either.right(config)
37}
38
39export type { PrismaConfigInternal }
40

Callers 1

defineConfigFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…