diff --git a/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx b/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx index 82ba4d9103..e3196ee347 100644 --- a/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx +++ b/content/200-orm/200-prisma-client/000-setup-and-configuration/010-generating-prisma-client.mdx @@ -12,6 +12,30 @@ In Prisma ORM 7, Prisma Client will no longer be generated in `node_modules` by ::: +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). + +::: + + To generate and instantiate Prisma Client: 1. Ensure that you have [Prisma CLI installed on your machine](/orm/tools/prisma-cli#installation). diff --git a/content/200-orm/200-prisma-client/500-deployment/001-deploy-prisma.mdx b/content/200-orm/200-prisma-client/500-deployment/001-deploy-prisma.mdx index f916638eb1..f6c7015e4e 100644 --- a/content/200-orm/200-prisma-client/500-deployment/001-deploy-prisma.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/001-deploy-prisma.mdx @@ -5,11 +5,29 @@ metaDescription: 'Learn more about the different deployment paradigms for Node.j tocDepth: 2 --- - - Projects using Prisma Client can be deployed to many different cloud platforms. Given the variety of cloud platforms and different names, it's noteworthy to mention the different deployment paradigms, as they affect the way you deploy an application using Prisma Client. - +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). +::: ## Deployment paradigms diff --git a/content/200-orm/200-prisma-client/500-deployment/201-serverless/150-deploy-to-azure-functions.mdx b/content/200-orm/200-prisma-client/500-deployment/201-serverless/150-deploy-to-azure-functions.mdx index ca6fe64377..083e7a04ac 100644 --- a/content/200-orm/200-prisma-client/500-deployment/201-serverless/150-deploy-to-azure-functions.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/201-serverless/150-deploy-to-azure-functions.mdx @@ -8,6 +8,30 @@ This guide explains how to avoid common issues when deploying a Node.js-based fu Azure Functions is a serverless deployment platform. You do not need to maintain infrastructure to deploy your code. With Azure Functions, the fundamental building block is the [function app](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference?tabs=blob&pivots=programming-language-typescript). A function app provides an execution context in Azure in which your functions run. It is comprised of one or more individual functions that Azure manages, deploys, and scales together. You can organize and collectively manage multiple functions as a single logical unit. +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: + + ## Prerequisites - An existing function app project with Prisma ORM diff --git a/content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx b/content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx index e0048b65e7..60d7928198 100644 --- a/content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/201-serverless/300-deploy-to-vercel.mdx @@ -12,6 +12,28 @@ We created an [example application](https://github.com/prisma/deployment-example While our examples use Next.js, you can deploy other applications to Vercel. See [Using Express with Vercel](https://vercel.com/guides/using-express-with-vercel) and [Nuxt on Vercel](https://vercel.com/docs/frameworks/nuxt) as examples of other options. +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). +::: + ## Build configuration ### Updating Prisma Client during Vercel builds diff --git a/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx b/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx index 2b278c16d8..36ff0bd435 100644 --- a/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/201-serverless/400-deploy-to-aws-lambda.mdx @@ -5,7 +5,6 @@ metaDescription: 'Learn how to deploy your Prisma ORM-backed applications to AWS tocDepth: 3 --- - This guide explains how to avoid common issues when deploying a project using Prisma ORM to [AWS Lambda](https://aws.amazon.com/lambda/). @@ -15,7 +14,33 @@ While a deployment framework is not required to deploy to AWS Lambda, this guide - [Serverless Framework](https://www.serverless.com/framework) provides a CLI that helps with workflow automation and AWS resource provisioning. While Prisma ORM works well with the Serverless Framework "out of the box", there are a few improvements that can be made within your project to ensure a smooth deployment and performance. There is also additional configuration that is needed if you are using the [`serverless-webpack`](https://www.npmjs.com/package/serverless-webpack) or [`serverless-bundle`](https://www.npmjs.com/package/serverless-bundle) libraries. - [SST](https://sst.dev/) provides tools that make it easy for developers to define, test, debug, and deploy their applications. Prisma ORM works well with SST but must be configured so that your schema is correctly packaged by SST. - + +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. If you adopt the no-Rust-engine setup, you can ignore subsequent sections about `binaryTargets`, copying/packaging native engine files, and pruning `libquery_engine-*` artifacts. + +Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: + + ## General considerations when deploying to AWS Lambda diff --git a/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx b/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx index 3a0296f488..02cc3f6cc1 100644 --- a/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/201-serverless/500-deploy-to-netlify.mdx @@ -8,6 +8,32 @@ This guide covers the steps you will need to take in order to deploy your applic Netlify is a cloud platform for continuous deployment, static sites, and serverless functions. Netlify integrates seamlessly with GitHub for automatic deployments upon commits. When you follow the steps below, you will use that approach to create a CI/CD pipeline that deploys your application from a GitHub repository. +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). If you use this setup, you do not need to configure `binaryTargets` in your Prisma schema below. + +Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: + + ## Prerequisites Before you can follow this guide, you will need to set up your application to begin deploying to Netlify. We recommend the ["Get started with Netlify"](https://docs.netlify.com/get-started/) guide for a quick overview and ["Deploy functions"](https://docs.netlify.com/functions/deploy/?fn-language=ts) for an in-depth look at your deployment options. @@ -39,7 +65,7 @@ binaryTargets = ["native", "rhel-openssl-3.0.x"] ## Store environment variables in Netlify -We recommend keeping `.env` files in your `.gitignore` in order to prevent leakage of sensitives connection strings. Instead, you can use the Netlify CLI to [import values into netlify directly](https://docs.netlify.com/environment-variables/get-started/#import-variables-with-the-netlify-cli). +We recommend keeping `.env` files in your `.gitignore` in order to prevent leakage of sensitive connection strings. Instead, you can use the Netlify CLI to [import values into netlify directly](https://docs.netlify.com/environment-variables/get-started/#import-variables-with-the-netlify-cli). Assuming you have a file like the following: @@ -78,7 +104,7 @@ site: my-very-very-cool-site
If you are not using an `.env` file -If you are storing your database connection string and other environment variables in a different method, you will need to manually upload your environment variables to Netlify. These options are [discussed in Netlfiy's documentation](https://docs.netlify.com/environment-variables/get-started/) and one method, uploading via the UI, is described below. +If you are storing your database connection string and other environment variables in a different method, you will need to manually upload your environment variables to Netlify. These options are [discussed in Netlify's documentation](https://docs.netlify.com/environment-variables/get-started/) and one method, uploading via the UI, is described below. 1. Open the Netlify admin UI for the site. You can use Netlify CLI as follows: ```terminal diff --git a/content/200-orm/200-prisma-client/500-deployment/201-serverless/index.mdx b/content/200-orm/200-prisma-client/500-deployment/201-serverless/index.mdx index 4593419b25..1ce3857ce1 100644 --- a/content/200-orm/200-prisma-client/500-deployment/201-serverless/index.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/201-serverless/index.mdx @@ -5,11 +5,37 @@ metaDescription: 'Learn how to deploy your Prisma ORM-backed apps to FaaS provid tocDepth: 2 --- - - 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](/orm/prisma-client/deployment/serverless/deploy-to-aws-lambda) and [Vercel Serverless Functions](/orm/prisma-client/deployment/serverless/deploy-to-vercel). - +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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 + +Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: ## Guides for Serverless Function providers diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx index 195342584f..a6f19130bc 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/100-overview.mdx @@ -20,6 +20,37 @@ Here is a brief overview of all the edge function providers that are currently s Deploying edge functions that use Prisma ORM on Cloudflare and Vercel is currently in [Preview](/orm/more/releases#preview). +:::note + +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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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 + +Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: + + ## Edge-compatibility of database drivers ### Why are there limitations around database drivers in edge functions? diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx index 181147dc76..9b90d89601 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/450-deploy-to-cloudflare.mdx @@ -9,6 +9,28 @@ sidebar_class_name: preview-badge This page covers everything you need to know to deploy an app with Prisma ORM to a [Cloudflare Worker](https://developers.cloudflare.com/workers/) or to [Cloudflare Pages](https://developers.cloudflare.com/pages). +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). +::: + ## General considerations when deploying to Cloudflare Workers This section covers _general_ things you need to be aware of when deploying to Cloudflare Workers or Pages and are using Prisma ORM, regardless of the database provider you use. diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx index 2f1469922a..06edfa8c9a 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/485-deploy-to-vercel.mdx @@ -7,13 +7,31 @@ tocDepth: 3 sidebar_class_name: preview-badge --- - - This page covers everything you need to know to deploy an app that uses Prisma Client for talking to a database in [Vercel Edge Middleware](https://vercel.com/docs/functions/edge-middleware) or a [Vercel Function](https://vercel.com/docs/functions) deployed to the [Vercel Edge Runtime](https://vercel.com/docs/functions/runtimes/edge-runtime). To deploy a Vercel Function to the Vercel Edge Runtime, you can set `export const runtime = 'edge'` outside the request handler of the Vercel Function. - +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). +::: ## General considerations when deploying to Vercel Edge Functions & Edge Middleware diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/550-deploy-to-deno-deploy.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/550-deploy-to-deno-deploy.mdx index aad497d311..4cbe7461b3 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/550-deploy-to-deno-deploy.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/550-deploy-to-deno-deploy.mdx @@ -4,19 +4,42 @@ metaTitle: 'Deploy to Deno Deploy' metaDescription: 'Learn how to deploy a TypeScript application to Deno Deploy.' --- - + With this guide, you can learn how to build and deploy a simple application to [Deno Deploy](https://deno.com/deploy). The application uses Prisma ORM to save a log of each request to a [Prisma Postgres](/postgres) database. This guide covers the use of Prisma CLI with Deno CLI, Deno Deploy, Prisma Client, and Prisma Postgres. - +:::info + +This guide demonstrates how to deploy an application to Deno Deploy with a Prisma Postgres database, but you can also use [your own database with Prisma Accelerate](/accelerate/getting-started#prerequisites). + +::: + +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). -This guide demonstrates how to deploy an application to Deno Deploy in conjunction with a Prisma Postgres database, but you can also use [your own database with Prisma Accelerate](/accelerate/getting-started#prerequisites). +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: - +```prisma +generator client { + provider = "prisma-client" + runtime = "deno" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: - ## Prerequisites diff --git a/content/200-orm/200-prisma-client/500-deployment/301-edge/index.mdx b/content/200-orm/200-prisma-client/500-deployment/301-edge/index.mdx index cb46530bec..c0df34d0c1 100644 --- a/content/200-orm/200-prisma-client/500-deployment/301-edge/index.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/301-edge/index.mdx @@ -5,11 +5,33 @@ metaDescription: 'Learn how to deploy your Prisma ORM-backed apps to edge functi tocDepth: 2 --- - If your application is deployed via an "Edge Function" offering or is deployed from a [serverless](/orm/prisma-client/deployment/serverless) offering and has a non-standard runtime, it is a _edge-deployed_ app. Common examples for such offerings include [Cloudflare Workers or Pages](/orm/prisma-client/deployment/edge/deploy-to-cloudflare), [Vercel Edge Functions or Edge Middleware](/orm/prisma-client/deployment/edge/deploy-to-vercel), and [Deno Deploy](/orm/prisma-client/deployment/edge/deploy-to-deno-deploy). - + +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: + ## In this section diff --git a/content/200-orm/200-prisma-client/500-deployment/700-deploy-to-a-different-os.mdx b/content/200-orm/200-prisma-client/500-deployment/700-deploy-to-a-different-os.mdx index c5fe8bba34..b727205e23 100644 --- a/content/200-orm/200-prisma-client/500-deployment/700-deploy-to-a-different-os.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/700-deploy-to-a-different-os.mdx @@ -22,8 +22,9 @@ generator client { > Note that the [driver adapters](/orm/overview/databases/database-drivers#driver-adapters) Preview feature is required alongside `queryCompiler`. -::: +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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). +::: The query engine is implemented in Rust and is used by Prisma Client in the form of executable binary files. The binary is downloaded when `prisma generate` is called. diff --git a/content/200-orm/200-prisma-client/500-deployment/index.mdx b/content/200-orm/200-prisma-client/500-deployment/index.mdx index 77ef685553..0d6ae1d001 100644 --- a/content/200-orm/200-prisma-client/500-deployment/index.mdx +++ b/content/200-orm/200-prisma-client/500-deployment/index.mdx @@ -5,12 +5,39 @@ metaDescription: 'How to deploy a Node.js application that uses Prisma Client an hide_table_of_contents: true --- - - This section describes how to deploy Node.js applications that use Prisma Client and TypeScript to various platforms. - +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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 + +Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + +::: + ## In this section - + \ No newline at end of file diff --git a/content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx b/content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx new file mode 100644 index 0000000000..abcc423894 --- /dev/null +++ b/content/200-orm/200-prisma-client/700-debugging-and-troubleshooting/245-troubleshooting-binary-size-issues.mdx @@ -0,0 +1,36 @@ +--- +title: 'Troubleshooting binary size and deployment issues' +metaTitle: 'Troubleshooting Prisma ORM binary size and deployment issues' +metaDescription: 'This page covers how to resolve large bundle sizes, slow builds, and deployment errors caused by Prisma ORM Rust engine binaries' +hide_table_of_contents: true +--- + +If you encounter **large bundle sizes**, **slow builds**, or **deployment errors** related to Prisma’s Rust engine binaries, for example, in serverless or edge environments, the issue may be caused by the default native Rust query engine that ships with Prisma Client. + +As of [v6.7.0](https://pris.ly/release/6.7.0), you can resolve these issues by enabling the [`queryCompiler`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature. +When enabled, Prisma Client is generated **without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies. + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +```` + +:::note +The [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) Preview feature is **required** alongside `queryCompiler`. +::: + +With this architecture: + +* No Rust query engine binary is downloaded or shipped. +* The database connection pool is maintained by the native JavaScript database driver you install (e.g., `@prisma/adapter-pg` for PostgreSQL). + +This setup can help if you are: + +* Deploying to serverless functions or edge runtimes +* Running in read-only filesystem environments +* Working within CI/CD pipelines with strict size limits + +Visit [this page](/orm/prisma-client/setup-and-configuration/no-rust-engine) for complete setup instructions and supported databases. 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](https://www.prisma.io/blog/try-the-new-rust-free-version-of-prisma-orm-early-access). + diff --git a/content/200-orm/500-reference/050-prisma-client-reference.mdx b/content/200-orm/500-reference/050-prisma-client-reference.mdx index c0966828e2..3dc9694b05 100644 --- a/content/200-orm/500-reference/050-prisma-client-reference.mdx +++ b/content/200-orm/500-reference/050-prisma-client-reference.mdx @@ -7,6 +7,29 @@ tocDepth: 3 toc: true --- +:::tip 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`](/orm/prisma-client/setup-and-configuration/no-rust-engine) Preview feature introduced in [v6.7.0](https://pris.ly/release/6.7.0). + +**When enabled, Prisma Client is generated without a Rust-based query engine binary**, reducing build artifacts and removing native binary dependencies: + +```prisma +generator client { + provider = "prisma-client-js" + previewFeatures = ["queryCompiler", "driverAdapters"] +} +``` + +Note that the [`driverAdapters`](/orm/overview/databases/database-drivers#driver-adapters) 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. Learn more in the [docs here](/orm/prisma-client/setup-and-configuration/no-rust-engine). + +::: + The Prisma Client API reference documentation is based on the following schema: ```prisma