Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,231
  • Linux
  • Apple
test.ts1.53 kB
import { inspect } from 'util' import testMatrix from './_matrix' // @ts-ignore import type { PrismaClient } from './generated/prisma/client' declare let prisma: PrismaClient testMatrix.setupTestSuite(() => { beforeAll(async () => { await prisma.user.create({ data: { email: 'user@example.com' } }) }) test('it is possible to inspect/log prisma client', () => { expect(() => inspect(prisma)).not.toThrow() }) test('result extensions are still logged/inspected correctly', async () => { const xprisma = prisma.$extends({ result: { user: { computedField: { needs: [], compute() { return 'HELLO!!!' }, }, }, }, }) const user = await xprisma.user.findFirstOrThrow({ select: { computedField: true, email: true } }) expect(inspect(user)).toMatchInlineSnapshot(`"{ email: 'user@example.com', computedField: 'HELLO!!!' }"`) }) test('depth option is respected', async () => { const xprisma = prisma.$extends({ result: { user: { computedField: { needs: [], compute() { return { deeply: { nested: { value: 123 } } } }, }, }, }, }) const user = await xprisma.user.findFirstOrThrow({ select: { computedField: true, email: true } }) expect(inspect(user, { depth: 1 })).toMatchInlineSnapshot( `"{ email: 'user@example.com', computedField: { deeply: [Object] } }"`, ) }) })

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