Skip to main content
Glama

Prisma MCP Server

Official
by prisma
Apache 2.0
4
44,192
  • Linux
  • Apple
printUpdateMessage.ts2.25 kB
import { drawBox, isCurrentBinInstalledGlobally } from '@prisma/internals' import type { Check } from 'checkpoint-client' import { blue, bold } from 'kleur/colors' const isPrismaInstalledGlobally = isCurrentBinInstalledGlobally() export function printUpdateMessage(checkResult: Check.Result | 0 | void): void { const shouldHide = process.env.PRISMA_HIDE_UPDATE_MESSAGE if (!checkResult || checkResult.status !== 'ok' || shouldHide || !checkResult.data.outdated) { return } let boxHeight = 4 let majorText = '' const currentVersionInstalled = checkResult.data.previous_version const latestVersionAvailable = checkResult.data.current_version const prismaCLICommand = makeInstallCommand(checkResult.data.package, checkResult.data.release_tag) const prismaClientCommand = makeInstallCommand('@prisma/client', checkResult.data.release_tag, { canBeGlobal: false, canBeDev: false, }) try { const [majorInstalled] = currentVersionInstalled.split('.') const [majorLatest] = latestVersionAvailable.split('.') if (majorInstalled < majorLatest) { majorText = `\nThis is a major update - please follow the guide at\nhttps://pris.ly/d/major-version-upgrade\n\n` boxHeight = boxHeight + 4 } } catch (e) {} const boxText = `\n${blue( 'Update available', )} ${currentVersionInstalled} -> ${latestVersionAvailable}\n${majorText}Run the following to update ${bold(prismaCLICommand)} ${bold(prismaClientCommand)}` const boxedMessage = drawBox({ height: boxHeight, width: 59, str: boxText, horizontalPadding: 2, }) console.error(boxedMessage) } function makeInstallCommand( packageName: string, tag: string, options = { canBeGlobal: true, canBeDev: true, }, ): string { let command = '' if (isPrismaInstalledGlobally === 'npm' && options.canBeGlobal) { command = `npm i -g ${packageName}` } else if (options.canBeDev) { command = `npm i --save-dev ${packageName}` } else { command = `npm i ${packageName}` } // always output tag (so major upgrades work) // see https://www.npmjs.com/package/prisma?activeTab=versions // (can only be latest or dev via checkpoint-server) command += `@${tag}` return command }

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