Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
Property.ts1.42 kB
import { isValidJsIdentifier } from '@prisma/internals' import { BasicBuilder } from './BasicBuilder' import { DocComment } from './DocComment' import { TypeBuilder } from './TypeBuilder' import { WellKnownSymbol } from './WellKnownSymbol' import { Writer } from './Writer' export class Property implements BasicBuilder { private isOptional = false private isReadonly = false private docComment?: DocComment constructor( private name: string | WellKnownSymbol, private type: TypeBuilder, ) {} optional(): this { this.isOptional = true return this } readonly(): this { this.isReadonly = true return this } setDocComment(docComment: DocComment): this { this.docComment = docComment return this } write(writer: Writer): void { if (this.docComment) { writer.write(this.docComment) } if (this.isReadonly) { writer.write('readonly ') } if (typeof this.name === 'string') { if (isValidJsIdentifier(this.name)) { writer.write(this.name) } else { writer.write('[').write(JSON.stringify(this.name)).write(']') } } else { writer.write('[').write(this.name).write(']') } if (this.isOptional) { writer.write('?') } writer.write(': ').write(this.type) } } export function property(name: string | WellKnownSymbol, type: TypeBuilder) { return new Property(name, type) }

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