Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,213
  • Linux
  • Apple
tests.ts1.59 kB
import { Providers } from '../_utils/providers' import { Db, NewPrismaClient } from '../_utils/types' import testMatrix from './_matrix' // @ts-ignore import type { PrismaClient } from './generated/prisma/client' declare const newPrismaClient: NewPrismaClient<PrismaClient, typeof PrismaClient> declare const db: Db let prisma: PrismaClient testMatrix.setupTestSuite( () => { test('example', async () => { // Ensure that the db is down await db.dropDb() prisma = newPrismaClient() // Try sending a query without a spawned database await expect(prisma.user.findMany()).rejects.toThrow() // Spawn the database await db.setupDb() // Expect it to work await expect(prisma.user.findMany()).resolves.toEqual([]) }) }, { skipDb: true, // So we can manually spawn the database skipDefaultClientInstance: true, // So we can manually call connect for this test skipDataProxy: { runtimes: ['node', 'edge'], reason: ` Fails with Data Proxy: error is an instance of InvalidDatasourceError instead of Prisma.PrismaClientInitializationError. `, }, optOut: { from: [Providers.MONGODB], reason: 'First query does not fail even when database does not exist.', }, skipDriverAdapter: { // TODO: fix this case from: ['js_mssql'], reason: 'Driver fails with `Login failed for user ...`', }, skip(when, { clientEngineExecutor }) { when(clientEngineExecutor === 'remote', "Fails because it's not an Accelerate URL.") }, }, )

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