无服务器函数
如果你的应用是通过 "无服务器函数" 或 "函数即服务 (FaaS)" 产品部署并使用标准 Node.js 运行时,则它是无服务器应用。常见的部署示例包括 AWS Lambda 和 Vercel 无服务器函数。
¥If your application is deployed via a "Serverless Function" or "Function-as-a-Service (FaaS)" offering and uses a standard Node.js runtime, it is a serverless app. Common deployment examples include AWS Lambda and Vercel Serverless Functions.
If Prisma’s Rust engine binaries cause large bundle sizes, slow builds, or deployment issues (for example, in serverless or edge environments), you can switch to the queryCompiler
Preview feature introduced in v6.7.0.
When enabled, Prisma Client is generated without a Rust-based query engine binary, reducing build artifacts and removing native binary dependencies:
generator client {
provider = "prisma-client-js"
previewFeatures = ["queryCompiler", "driverAdapters"]
}
请注意,driverAdapters
预览功能与 queryCompiler
功能同时启用。When using this architecture:
¥Note that the driverAdapters
Preview feature is required alongside queryCompiler
.
When using this architecture:
-
No Rust query engine binary is downloaded or shipped.
-
The database connection pool is maintained by the native JS database driver you install (e.g.,
@prisma/adapter-pg
for PostgreSQL).
This setup can simplify deployments in:
-
无服务器函数
¥Serverless functions
-
Edge runtimes
-
Read-only filesystem environments
-
CI/CD pipelines with strict size limits
在 docs here 中了解更多信息。Curious why we're moving away from the Rust engine?Take a look at why we're transitioning from Rust binary engines to an all-TypeScript approach for a faster, lighter Prisma ORM in our 博客文章.
¥Learn more in the docs here. Curious why we're moving away from the Rust engine? Take a look at why we're transitioning from Rust binary engines to an all-TypeScript approach for a faster, lighter Prisma ORM in our blog post.
无服务器函数提供商指南
¥Guides for Serverless Function providers
部署到 Azure Functions
本指南介绍了使用 Azure 函数 将基于 Node.js 的函数应用部署到 Azure 时如何避免常见问题。
部署到 Vercel
本指南将引导你完成设置和部署使用 Prisma 到 Vercel 的无服务器应用的步骤。
部署到 AWS Lambda
本指南介绍了使用 Prisma ORM 将项目部署到 AWS Lambda 时如何避免常见问题。
部署到 Netlify
本指南涵盖了将使用 Prisma ORM 的应用部署到 Netlify 所需执行的步骤。