Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,213
  • Linux
  • Apple
tests.ts1.99 kB
import { AdapterProviders, Providers } from '../_utils/providers' 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('relationMode with deprecated `referentialIntegrity` datasource property', () => { beforeEach(async () => { await prisma.$transaction([prisma.profileOneToOne.deleteMany(), prisma.userOneToOne.deleteMany()]) }) afterAll(async () => { await prisma.$disconnect() }) test('[create] and [delete] should succeed', async () => { await prisma.userOneToOne.create({ data: { id: '1', profile: { create: { id: '1' }, }, }, include: { profile: true, }, }) expect(await prisma.userOneToOne.findMany()).toEqual([ { id: '1', enabled: null, }, ]) expect(await prisma.profileOneToOne.findMany()).toEqual([ { id: '1', userId: '1', enabled: null, }, ]) // onDelete: Cascade await prisma.userOneToOne.deleteMany() expect(await prisma.userOneToOne.findMany()).toEqual([]) expect(await prisma.profileOneToOne.findMany()).toEqual([]) }) }) }, { optOut: { from: [Providers.SQLSERVER, Providers.MYSQL, Providers.POSTGRESQL, Providers.COCKROACHDB, Providers.MONGODB], reason: 'Only testing SQLite, as this is just for testing the deprecated property', }, skipDriverAdapter: { from: [AdapterProviders.JS_LIBSQL], reason: 'js_libsql: SIGABRT crash occurs on having the first transaction with at least two create statements, panic inside `statement.rs` inside libsql', }, }, )

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