Skip to content

Commit

Permalink
feat(client): adapt generate success message for Data Proxy (#14424)
Browse files Browse the repository at this point in the history
Closes prisma/client-planning#73

Co-authored-by: Joël Galeran <Jolg42@users.noreply.github.com>
  • Loading branch information
aqrln and Jolg42 committed Jul 27, 2022
1 parent 64739d2 commit 7bf7d56
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/cli/src/Generate.ts
Expand Up @@ -234,8 +234,22 @@ ${chalk.dim('```')}
${highlightTS(`\
import { PrismaClient } from '${importPath}'
const prisma = new PrismaClient()`)}
${chalk.dim('```')}${breakingChangesStr}${versionsWarning}`
${chalk.dim('```')}${
prismaClientJSGenerator.options?.dataProxy
? `
To use Prisma Client in edge runtimes like Cloudflare Workers or Vercel Edge Functions, import it like this:
${chalk.dim('```')}
${highlightTS(`\
import { PrismaClient } from '${importPath}/edge'`)}
${chalk.dim('```')}
You will need a Prisma Data Proxy connection string. See documentation: ${link('https://pris.ly/d/data-proxy')}
`
: ''
}${breakingChangesStr}${versionsWarning}`
}

const message = '\n' + this.logText + (hasJsClient && !this.hasGeneratorErrored ? hint : '')

if (this.hasGeneratorErrored) {
Expand Down

0 comments on commit 7bf7d56

Please sign in to comment.