MCPcopy
hub / github.com/prisma/prisma / getConfigProvidedSchemaFile

Function getConfigProvidedSchemaFile

packages/internals/src/cli/getSchema.ts:254–266  ·  view source on GitHub ↗
(schemaPathFromConfig: string)

Source from the content-addressed store, hash-verified

252}
253
254export async function getConfigProvidedSchemaFile(schemaPathFromConfig: string): Promise<GetSchemaResult> {
255 const schemaResult = await readSchemaFromFileOrDirectory(schemaPathFromConfig)
256
257 if (!schemaResult.ok) {
258 throw new Error(
259 `Could not load schema from \`${schemaPathFromConfig}\` provided by "prisma.config.ts"\`: ${renderLookupError(
260 schemaResult.error,
261 )}`,
262 )
263 }
264
265 return schemaResult.schema
266}
267
268async function getDefaultSchema(cwd: string, failures: DefaultLookupRuleFailure[] = []): Promise<DefaultLookupResult> {
269 const lookupPaths = [path.join(cwd, 'schema.prisma'), path.join(cwd, 'prisma', 'schema.prisma')]

Callers 1

Calls 2

renderLookupErrorFunction · 0.85

Tested by

no test coverage detected