MCPcopy
hub / github.com/prisma/prisma / getSchemaWithPathOptional

Function getSchemaWithPathOptional

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

Source from the content-addressed store, hash-verified

96 * @returns
97 */
98export async function getSchemaWithPathOptional({
99 schemaPath,
100 cwd = process.cwd(),
101 argumentName = '--schema',
102}: GetSchemaOptions): Promise<GetSchemaResult | null> {
103 const result = await getSchemaWithPathInternal({ schemaPath, cwd, argumentName })
104 if (result.ok) {
105 return result.schema
106 }
107 return null
108}
109
110export function printSchemaLoadedMessage(schemaPath: string) {
111 process.stderr.write(dim(`Prisma schema loaded from ${path.relative(process.cwd(), schemaPath)}.`) + '\n')

Callers 1

loadSchemaContextFunction · 0.90

Calls 1

Tested by

no test coverage detected