Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,221
  • Linux
  • Apple
tests.ts2.01 kB
import { AdapterProviders } from '../../_utils/providers' import testMatrix from './_matrix' // @ts-ignore import type { PrismaClient } from './generated/prisma/client' declare let prisma: PrismaClient /** * Regression test for #11740 & comment * Stored queries in variables for batched tx */ testMatrix.setupTestSuite( ({ engineType }) => { testIf(engineType !== 'binary')('stored query triggered twice should fail but not exit process', async () => { const query = prisma.resource.create({ data: { email: 'john@prisma.io', }, }) const result = prisma.$transaction([query, query]) await expect(result).rejects.toMatchPrismaErrorSnapshot() }) testIf(engineType !== 'binary')('stored query trigger .requestTransaction twice should fail', async () => { const query = prisma.resource.create({ data: { email: 'john@prisma.io', }, }) const fn = async () => { await (query as any).requestTransaction({ kind: 'batch', lock: Promise.resolve() }) await (query as any).requestTransaction({ kind: 'batch', lock: Promise.resolve() }) } await expect(fn()).rejects.toMatchPrismaErrorSnapshot() }) testIf(engineType !== 'binary')('no multiple resolves should happen', async () => { const mockMultipleResolve = jest.fn() process.on('multipleResolves', mockMultipleResolve) const query = prisma.resource.create({ data: { email: 'john@prisma.io' } }) const result = prisma.$transaction([query, query]) await expect(result).rejects.toThrow() expect(mockMultipleResolve).toHaveBeenCalledTimes(0) }) }, { skipDataProxy: { runtimes: ['edge'], reason: 'Skipped because of the error snapshots on edge client', }, skipDriverAdapter: { from: [AdapterProviders.JS_LIBSQL], reason: 'js_libsql: SIGABRT due to panic in libsql (not yet implemented: unsupported type)', // TODO: ORM-867 }, }, )

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