Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,210
  • Linux
  • Apple
tests.ts2.34 kB
import { randomBytes } from 'crypto' import testMatrix from './_matrix' // @ts-ignore import type { PrismaClient } from './generated/prisma/client' declare let prisma: PrismaClient testMatrix.setupTestSuite( () => { const bytes1 = new Uint8Array(randomBytes(16)) const bytes2 = new Uint8Array(randomBytes(16)) beforeAll(async () => { await prisma.resource.createMany({ data: [{ bytes: bytes1 }, { bytes: bytes2 }], }) }) test('findUnique bytes with Promise.all', async () => { const result = await Promise.all([ prisma.resource.findUnique({ where: { bytes: bytes1 }, select: { bytes: true }, }), prisma.resource.findUnique({ where: { bytes: bytes2 }, select: { bytes: true }, }), ]) expect(result).toMatchObject([{ bytes: bytes1 }, { bytes: bytes2 }]) }) test('findUnique bytes with $transaction([...])', async () => { const result = await prisma.$transaction([ prisma.resource.findUnique({ where: { bytes: bytes1 }, select: { bytes: true }, }), prisma.resource.findUnique({ where: { bytes: bytes2 }, select: { bytes: true }, }), ]) expect(result).toMatchObject([{ bytes: bytes1 }, { bytes: bytes2 }]) }) test('findFirst bytes with Promise.all', async () => { const result = await Promise.all([ prisma.resource.findFirst({ where: { bytes: bytes1 }, select: { bytes: true }, }), prisma.resource.findFirst({ where: { bytes: bytes2 }, select: { bytes: true }, }), ]) expect(result).toMatchObject([{ bytes: bytes1 }, { bytes: bytes2 }]) }) test('findFirst bytes with $transaction([...])', async () => { const result = await prisma.$transaction([ prisma.resource.findFirst({ where: { bytes: bytes1 }, select: { bytes: true }, }), prisma.resource.findFirst({ where: { bytes: bytes2 }, select: { bytes: true }, }), ]) expect(result).toMatchObject([{ bytes: bytes1 }, { bytes: bytes2 }]) }) }, { optOut: { from: ['sqlserver'], reason: 'SQL Server does not support bytes IDs', }, }, )

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