Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
ModelFieldRefs.ts813 B
import * as DMMF from '@prisma/dmmf' import { getFieldRefsTypeName, getRefAllowedTypeName } from '../utils' export class ModelFieldRefs { constructor(protected outputType: DMMF.OutputType) {} toTS() { const { name } = this.outputType return ` /** * Fields of the ${name} model */ export interface ${getFieldRefsTypeName(name)} { ${this.stringifyFields()} } ` } private stringifyFields() { const { name } = this.outputType return this.outputType.fields .filter((field) => field.outputType.location !== 'outputObjectTypes') .map((field) => { const fieldOutput = field.outputType const refTypeName = getRefAllowedTypeName(fieldOutput) return ` readonly ${field.name}: Prisma.FieldRef<"${name}", ${refTypeName}>` }) .join('\n') } }

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