Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
test-handlePanic.ts1.46 kB
import { handlePanic, inferDirectoryConfig, loadSchemaContext, toSchemasContainer } from '@prisma/internals' import { Migrate } from '@prisma/migrate' import path from 'path' async function main() { const packageJsonVersion = '0.0.0' const enginesVersion = 'prismaEngineVersionHash' const command = 'something-test' try { const dirPath = path.join(__dirname, '..', '__tests__', 'fixtures', 'introspection', 'postgresql') process.chdir(dirPath) const schemaContext = await loadSchemaContext({ schemaPathFromArg: path.join(dirPath, 'schema.prisma') }) const { viewsDirPath } = inferDirectoryConfig(schemaContext) const migrate = await Migrate.setup({ schemaContext }) const engine = migrate.engine await engine.introspect({ schema: toSchemasContainer(schemaContext.schemaFiles), viewsDirectoryPath: viewsDirPath, baseDirectoryPath: dirPath, force: false, }) await engine.debugPanic() } catch (err) { console.debug({ err }) const getDatabaseVersionSafe = () => Promise.resolve(undefined) handlePanic({ error: err, cliVersion: packageJsonVersion, enginesVersion, command, getDatabaseVersionSafe, }) .catch((e) => { console.error('Error: ' + e.stack) console.error('Error: ' + e.message) }) .finally(() => { process.exit(1) }) } } main().catch((e) => { console.error(e) process.exit(1) })

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/prisma/prisma'

If you have feedback or need assistance with the MCP directory API, please join our Discord server