Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,213
  • Linux
  • Apple
tests.ts1.52 kB
import { Providers } from '../../_utils/providers' import testMatrix from './_matrix' // @ts-ignore import type { PrismaClient } from './generated/prisma/client' declare let prisma: PrismaClient // https://github.com/prisma/prisma/issues/11974 testMatrix.setupTestSuite( () => { beforeAll(async () => { await prisma.comment.create({ data: { id: '1', downVotedUsers: { create: { uid: '2' }, }, upVotedUsers: { create: { uid: '3', }, }, }, }) }) test('should not throw an error when counting two relation fields using find', async () => { const response = await prisma.comment.findMany({ include: { _count: { select: { upVotedUsers: true, downVotedUsers: true, }, }, }, }) expect(response).toMatchObject([{ id: '1', _count: { upVotedUsers: 1, downVotedUsers: 1 } }]) }) test('should not throw an error when aggregating two relation fields using aggregate', async () => { const response = await prisma.comment.aggregate({ where: { AND: [{ downVotedUsers: { every: { uid: '2' } } }, { upVotedUsers: { every: { uid: '3' } } }], }, _count: true, }) expect(response).toMatchObject({ _count: 1 }) }) }, { optOut: { from: [Providers.MONGODB], reason: 'Implicit relations are not supported in MongoDB' } }, )

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