MCPcopy
hub / github.com/prisma/prisma / formatCompletionOutput

Function formatCompletionOutput

packages/cli/src/postgres/link/completion-output.ts:7–32  ·  view source on GitHub ↗
(opts: LinkResult)

Source from the content-addressed store, hash-verified

5import { formatEnvSummary } from './local-setup'
6
7export function formatCompletionOutput(opts: LinkResult): string {
8 const lines: string[] = []
9
10 lines.push('')
11 lines.push(green('✔') + bold(' Prisma Postgres linked successfully!'))
12 lines.push('')
13 lines.push(formatEnvSummary(opts.localFilesResult))
14 lines.push('')
15 lines.push(bold('Next steps:'))
16
17 if (opts.hasModels) {
18 lines.push(` 1. Run ${green(getCommandWithExecutor('prisma generate'))} to generate the Prisma Client`)
19 lines.push(` 2. Run ${green(getCommandWithExecutor('prisma migrate dev'))} to apply your schema to the database`)
20 lines.push(
21 ` 3. Start querying: ${dim('https://www.prisma.io/docs/getting-started/quickstart#4-explore-how-to-send-queries-to-your-database-with-prisma-client')}`,
22 )
23 } else {
24 lines.push(` 1. Define your data model in ${green('prisma/schema.prisma')}`)
25 lines.push(` 2. Run ${green(getCommandWithExecutor('prisma migrate dev'))} to create the database tables`)
26 lines.push(` 3. Run ${green(getCommandWithExecutor('prisma generate'))} and start querying`)
27 }
28
29 lines.push('')
30
31 return lines.join('\n')
32}

Callers 1

parseMethod · 0.90

Calls 3

formatEnvSummaryFunction · 0.90
getCommandWithExecutorFunction · 0.90
pushMethod · 0.45

Tested by

no test coverage detected