diff --git a/content/250-postgres/350-integrations/100-netlify.mdx b/content/250-postgres/350-integrations/100-netlify.mdx index 9cbd243363..c9d6d10096 100644 --- a/content/250-postgres/350-integrations/100-netlify.mdx +++ b/content/250-postgres/350-integrations/100-netlify.mdx @@ -52,7 +52,8 @@ Ensure that the data source in your `schema.prisma` file is configured to use th ```prisma // schema.prisma generator client { - provider = "prisma-client-js" + provider = "prisma-client" + output = "./generated" } datasource db { @@ -71,14 +72,12 @@ To ensure the generated Prisma Client library is available on your deployed Netl "scripts": { // ... // add-next-line - "postinstall": "prisma generate --no-engine" + "postinstall": "prisma generate" } // } ``` -The `--no-engine` flag ensures that the query engine binary is kept out of the generated Prisma Client library. It's not needed when using Prisma Postgres. - ## Example: Deploy a Next.js template with Prisma Postgres This section contains step-by-step instructions for deploying a Netlify site and connecting it to Prisma Postgres from scratch using Netlify's official [Next.js Platform Starter](https://github.com/netlify-templates/next-platform-starter) template. @@ -130,7 +129,8 @@ In this section, you are going to add Prisma Postgres to the starter project _on 1. Open the newly created `schema.prisma` file and add the following model to it: ```prisma file=schema.prisma generator client { - provider = "prisma-client-js" + provider = "prisma-client" + output = "./generated" } datasource db { @@ -161,9 +161,11 @@ In this section, you are going to add Prisma Postgres to the starter project _on Open the `app/page.jsx` file and replace the entire contents with this code: ```js file=app/page.jsx -import { PrismaClient } from '@prisma/client' +import { PrismaClient } from '../prisma/generated/client' +import { PrismaPg } from '@prisma/adapter-pg' -const prisma = new PrismaClient(); +const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }) +const prisma = new PrismaClient({ adapter }) export default async function Page() { const users = await prisma.user.findMany(); @@ -212,11 +214,12 @@ As mentioned [above](#generate-prisma-client-in-a-postinstall-script-in-packagej "start": "next start", "lint": "next lint", // add-next-line - "postinstall": "prisma generate --no-engine" + "postinstall": "prisma generate" }, "dependencies": { "@netlify/blobs": "^8.1.0", - "@prisma/client": "^6.3.0", + "@prisma/adapter-pg": "^7.0.0", + "@prisma/client": "^7.0.0", "@prisma/extension-accelerate": "^1.2.1", "blobshape": "^1.0.0", "bright": "^0.8.5", @@ -232,7 +235,7 @@ As mentioned [above](#generate-prisma-client-in-a-postinstall-script-in-packagej "eslint": "8.57.1", "eslint-config-next": "15.1.6", "postcss": "^8.4.36", - "prisma": "^6.3.0", + "prisma": "^7.0.0", "tailwindcss": "^3.4.1" } } diff --git a/content/250-postgres/350-integrations/200-vercel.mdx b/content/250-postgres/350-integrations/200-vercel.mdx index 106e5264c2..e7b4500fff 100644 --- a/content/250-postgres/350-integrations/200-vercel.mdx +++ b/content/250-postgres/350-integrations/200-vercel.mdx @@ -92,10 +92,8 @@ To ensure the generated Prisma Client library is available on your deployed Verc "scripts": { // ... // add-next-line - "postinstall": "prisma generate --no-engine" + "postinstall": "prisma generate" } // } -``` - -The `--no-engine` flag ensures that the query engine binary is kept out of the generated Prisma Client library. It's not needed when using Prisma Postgres. +``` \ No newline at end of file diff --git a/content/250-postgres/400-query-optimization/100-setup.mdx b/content/250-postgres/400-query-optimization/100-setup.mdx index c5d87ea33d..710bc27848 100644 --- a/content/250-postgres/400-query-optimization/100-setup.mdx +++ b/content/250-postgres/400-query-optimization/100-setup.mdx @@ -46,7 +46,8 @@ For versions of Prisma ORM between `4.2.0` and `6.1.0`, you need to enable the ` ```prisma generator client { - provider = "prisma-client-js" + provider = "prisma-client" + output = "./generated" previewFeatures = ["tracing"] } ``` @@ -66,7 +67,7 @@ OPTIMIZE_API_KEY="YOUR_OPTIMIZE_API_KEY" Extend your existing Prisma Client instance with the Optimize extension: ```ts -import { PrismaClient } from "@prisma/client"; +import { PrismaClient } from "../prisma/generated/client"; import { withAccelerate } from "@prisma/extension-optimize"; import { withOptimize } from "@prisma/extension-optimize";