Skip to main content

边缘函数

如果你的应用是通过 "边缘函数" 产品部署的,或者是从 serverless 产品部署的,并且具有非标准运行时,则它是边缘部署的应用。此类产品的常见示例包括 Cloudflare Worker 或页面Vercel Edge 函数或 Edge 中间件Deno 部署

¥If your application is deployed via an "Edge Function" offering or is deployed from a serverless offering and has a non-standard runtime, it is a edge-deployed app. Common examples for such offerings include Cloudflare Workers or Pages, Vercel Edge Functions or Edge Middleware, and Deno Deploy.

Use Prisma ORM without Rust binaries

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 or edge runtimes.在 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 博客文章.

¥This setup can simplify deployments in serverless or edge runtimes. 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.

在这个部分

¥In this section