Skip to main content
Glama

Prisma MCP Server

Official
by prisma
tests.ts1.13 kB
import { faker } from '@faker-js/faker' import testMatrix from './_matrix' // @ts-ignore import type { PrismaClient } from './generated/prisma/client' declare let prisma: PrismaClient testMatrix.setupTestSuite(() => { test('should create a record using upsert', async () => { const name = faker.person.firstName() await prisma.user.upsert({ where: { name, }, create: { name, }, update: { name, }, }) const count = await prisma.user.count({ where: { name } }) expect(count).toEqual(1) }) test('should update a record using upsert', async () => { const name = faker.person.firstName() await prisma.user.create({ data: { name, }, }) await prisma.user.upsert({ where: { name, }, create: { name, }, update: { name: name + 'new', }, }) let count = await prisma.user.count({ where: { name } }) expect(count).toEqual(0) count = await prisma.user.count({ where: { name: name + 'new' } }) expect(count).toEqual(1) }) })

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