Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
resolveDatasources.test.ts1.8 kB
import path from 'node:path' import { expect, test } from 'vitest' import { absolutizeRelativePath } from './resolveDatasources' const cwd = '/Users/tim/project/prisma' const outputDir = '/Users/tim/project/node_modules/@prisma/client/runtime' expect.addSnapshotSerializer({ test: (val) => path.sep === '\\' && typeof val === 'string' && val.includes('\\'), serialize(val, config, indentation, depth, refs, printer) { const newVal = val.replaceAll('\\', '/') return printer(newVal, config, indentation, depth, refs) }, }) test('absolutizeRelativePath', () => { expect(absolutizeRelativePath('file:db.db', cwd, outputDir)).toMatchInlineSnapshot(`"../../../../prisma/db.db"`) expect(absolutizeRelativePath('file:/db.db', cwd, outputDir)).toMatchInlineSnapshot(`"../../../../../../../db.db"`) expect(absolutizeRelativePath('file:../db.db', cwd, outputDir)).toMatchInlineSnapshot(`"../../../../db.db"`) expect(absolutizeRelativePath('file:./db.db', cwd, outputDir)).toMatchInlineSnapshot(`"../../../../prisma/db.db"`) expect(absolutizeRelativePath('file:asd/another/dir/db.db', cwd, outputDir)).toMatchInlineSnapshot( `"../../../../prisma/asd/another/dir/db.db"`, ) expect(absolutizeRelativePath('file:/some/random/dir/db.db', cwd, outputDir)).toMatchInlineSnapshot( `"../../../../../../../some/random/dir/db.db"`, ) expect( absolutizeRelativePath('file:/Users/tim/project/node_modules/@prisma/client/runtime', cwd, outputDir), ).toMatchInlineSnapshot(`""`) expect(absolutizeRelativePath('file:../another-dir/db.db', cwd, outputDir)).toMatchInlineSnapshot( `"../../../../another-dir/db.db"`, ) expect(absolutizeRelativePath('file:./some/dir/db.db', cwd, outputDir)).toMatchInlineSnapshot( `"../../../../prisma/some/dir/db.db"`, ) })

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