({
schemaPath,
cwd = process.cwd(),
argumentName = '--schema',
}: GetSchemaOptions)
| 96 | * @returns |
| 97 | */ |
| 98 | export 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 | |
| 110 | export function printSchemaLoadedMessage(schemaPath: string) { |
| 111 | process.stderr.write(dim(`Prisma schema loaded from ${path.relative(process.cwd(), schemaPath)}.`) + '\n') |
no test coverage detected