Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,213
  • Linux
  • Apple
tests.ts2.11 kB
import testMatrix from './_matrix' /* eslint-disable @typescript-eslint/no-unused-vars */ // @ts-ignore this is just for type checks declare let prisma: import('./generated/prisma/client').PrismaClient testMatrix.setupTestSuite( (suiteConfig, suiteMeta) => { describe('issue 12557', () => { afterAll(async () => { await prisma.$disconnect() }) test('issue 12557', async () => { await prisma.category.create({ data: { name: 'cat-1', brands: { create: [{ name: 'brand-1' }, { name: 'brand-2' }], }, }, }) await prisma.category.create({ data: { name: 'cat-2', brands: { create: [{ name: 'brand-3' }, { name: 'brand-4' }], }, }, include: { brands: true }, }) const categories = await prisma.category.findMany({ include: { _count: { select: { brands: true }, }, }, }) expect(categories).toMatchObject([ { _count: { brands: 2 }, name: 'cat-1', }, { _count: { brands: 2 }, name: 'cat-2', }, ]) await prisma.brand.delete({ where: { name: 'brand-1' } }) const categoriesAfterBrand1Deletion = await prisma.category.findMany({ include: { _count: { select: { brands: true }, }, }, }) expect(categoriesAfterBrand1Deletion).toMatchObject([ { _count: { brands: 1 }, name: 'cat-1', }, { _count: { brands: 2 }, name: 'cat-2', }, ]) }) }) }, // Use `optOut` to opt out from testing the default selected providers // otherwise the suite will require all providers to be specified. { optOut: { from: ['sqlite', 'mongodb', 'cockroachdb', 'sqlserver'], reason: 'Only testing MySQL and PostgreSQL', }, }, )

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