MCPcopy
hub / github.com/prisma/prisma / getSchemaWithPath

Function getSchemaWithPath

packages/internals/src/cli/getSchema.ts:70–80  ·  view source on GitHub ↗
({
  schemaPath,
  cwd = process.cwd(),
  argumentName = '--schema',
}: GetSchemaOptions)

Source from the content-addressed store, hash-verified

68 * Loads the schema, throws an error if it is not found
69 */
70export async function getSchemaWithPath({
71 schemaPath,
72 cwd = process.cwd(),
73 argumentName = '--schema',
74}: GetSchemaOptions): Promise<GetSchemaResult> {
75 const result = await getSchemaWithPathInternal({ schemaPath, cwd, argumentName })
76 if (result.ok) {
77 return result.schema
78 }
79 throw new Error(renderDefaultLookupError(result.error, cwd))
80}
81
82/**
83 * The schema path can be provided as a CLI argument, a configuration file, or a base directory

Callers 12

getTestClientFunction · 0.90
generateInFolderFunction · 0.90
loadSchemaContextFunction · 0.90
getProjectHashFunction · 0.90
testSchemaPathFunction · 0.90
parseMethod · 0.90
rpc.test.tsFile · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90
Format.test.tsFile · 0.90

Calls 2

renderDefaultLookupErrorFunction · 0.85

Tested by 1

testSchemaPathFunction · 0.72