Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
validatePrismaClientOptions.test.ts2.83 kB
import { validatePrismaClientOptions } from '../runtime/utils/validatePrismaClientOptions' const config = { datasourceNames: ['db'], } describe('valid options', () => { test('empty', () => { expect.assertions(0) validatePrismaClientOptions({}, config) }) test('full', () => { expect.assertions(0) validatePrismaClientOptions( { datasources: { db: { url: '', }, }, errorFormat: 'pretty', log: ['error'], }, config, ) validatePrismaClientOptions( { datasources: { db: { url: '', }, }, errorFormat: 'pretty', log: [ { emit: 'event', level: 'error', }, ], }, config, ) }) }) describe('invalid options', () => { test('typos', () => { expect(() => validatePrismaClientOptions( { errorsFormat: 'minimal', } as any, config, ), ).toThrowErrorMatchingInlineSnapshot(` "Unknown property errorsFormat provided to PrismaClient constructor. Did you mean "errorFormat"? Read more at https://pris.ly/d/client-constructor" `) expect(() => validatePrismaClientOptions( { errorFormat: 'minimal', datasources: { asd: {}, }, }, config, ), ).toThrowErrorMatchingInlineSnapshot(` "Unknown datasource asd provided to PrismaClient constructor. Available datasources: db Read more at https://pris.ly/d/client-constructor" `) expect(() => validatePrismaClientOptions( { errorFormat: 'minimal', datasources: { db: { murl: '' }, }, } as any, config, ), ).toThrowErrorMatchingInlineSnapshot(` "Invalid value {"db":{"murl":""}} for datasource "db" provided to PrismaClient constructor. It should have this form: { url: "CONNECTION_STRING" } Read more at https://pris.ly/d/client-constructor" `) expect(() => validatePrismaClientOptions( { errorFormat: 'minimal', log: [{ helo: 'world' }], } as any, config, ), ).toThrowErrorMatchingInlineSnapshot(` "Invalid property helo for "log" provided to PrismaClient constructor Read more at https://pris.ly/d/client-constructor" `) expect(() => validatePrismaClientOptions( { errorFormat: 'minimal', log: ['muery'], } as any, config, ), ).toThrowErrorMatchingInlineSnapshot(` "Invalid log level "muery" provided to PrismaClient constructor. Did you mean "query"? Read more at https://pris.ly/d/client-constructor" `) }) })

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