MCPcopy
hub / github.com/prisma/prisma / getModelNames

Function getModelNames

packages/cli/src/bootstrap/project-state.ts:55–65  ·  view source on GitHub ↗
(baseDir: string)

Source from the content-addressed store, hash-verified

53}
54
55export function getModelNames(baseDir: string): string[] {
56 const schemaPath = findSchemaPath(baseDir)
57 if (!schemaPath) return []
58 try {
59 const content = fs.readFileSync(schemaPath, 'utf-8')
60 const matches = content.matchAll(/^\s*model\s+(\w+)/gm)
61 return Array.from(matches, (m) => m[1])
62 } catch {
63 return []
64 }
65}
66
67export function getSeedCommand(baseDir: string): string | null {
68 const packageJsonPath = path.join(baseDir, 'package.json')

Callers 3

executeLinkFlowMethod · 0.90
runMethod · 0.90

Calls 2

findSchemaPathFunction · 0.85
fromMethod · 0.80

Tested by

no test coverage detected