在现有 TypeScript 项目中安装 Prisma 客户端(MongoDB)
安装并生成 Prisma 客户端
¥Install and generate Prisma Client
要开始使用 Prisma Client,你需要安装 @prisma/client
软件包:
¥To get started with Prisma Client, you need to install the @prisma/client
package:
npm install @prisma/client
安装命令会为你调用 prisma generate
,它会读取你的 Prisma 架构并生成适合你的模型的 Prisma 客户端版本。
¥The install command invokes prisma generate
for you which reads your Prisma schema and generates a version of Prisma Client that is tailored to your models.
将来每当你对 Prisma 模式进行更改时,你都需要手动调用 prisma generate
以适应 Prisma 客户端 API 中的更改。
¥Whenever you make changes to your Prisma schema in the future, you manually need to invoke prisma generate
in order to accommodate the changes in your Prisma Client API.