From 31b18fe141ac81570c71fbad851f16d2f3e6fbd3 Mon Sep 17 00:00:00 2001 From: Arthur Gamby Date: Wed, 3 Dec 2025 21:46:17 +0100 Subject: [PATCH] fix(docs): update setup configuration --- content/250-postgres/300-database/350-caching.mdx | 8 ++------ .../250-postgres/350-integrations/100-netlify.mdx | 8 +++----- content/300-accelerate/200-getting-started.mdx | 12 +++--------- content/800-guides/300-supabase-accelerate.mdx | 4 +--- content/800-guides/310-neon-accelerate.mdx | 4 +--- 5 files changed, 10 insertions(+), 26 deletions(-) diff --git a/content/250-postgres/300-database/350-caching.mdx b/content/250-postgres/300-database/350-caching.mdx index 064b6e1c7d..4890f8b4c8 100644 --- a/content/250-postgres/300-database/350-caching.mdx +++ b/content/250-postgres/300-database/350-caching.mdx @@ -50,9 +50,7 @@ Update your Prisma Client setup to use the Accelerate extension: import { PrismaClient } from '../generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' -const prisma = new PrismaClient({ - accelerateUrl: process.env.DATABASE_URL, -}).$extends(withAccelerate()) +const prisma = new PrismaClient().$extends(withAccelerate()) ``` @@ -63,9 +61,7 @@ const prisma = new PrismaClient({ import { PrismaClient } from '@prisma/client/edge' import { withAccelerate } from '@prisma/extension-accelerate' -const prisma = new PrismaClient({ - accelerateUrl: process.env.DATABASE_URL, -}).$extends(withAccelerate()) +const prisma = new PrismaClient().$extends(withAccelerate()) ``` diff --git a/content/250-postgres/350-integrations/100-netlify.mdx b/content/250-postgres/350-integrations/100-netlify.mdx index 2fe03aec24..cf24fdc39b 100644 --- a/content/250-postgres/350-integrations/100-netlify.mdx +++ b/content/250-postgres/350-integrations/100-netlify.mdx @@ -163,11 +163,9 @@ Open the `app/page.jsx` file and replace the entire contents with this code: ```tsx file=app/page.jsx import 'dotenv/config'; import { PrismaClient } from '../path/to/generated/prisma/client'; -import { withAccelerate } from '@prisam/extension-accelerate'; -const databaseUrl = process.env.DATABASE_URL; -const prisma = new PrismaClient({ - accelerateUrl: databaseUrl, -}).$extends(withAccelerate()); +import { withAccelerate } from '@prisma/extension-accelerate'; + +const prisma = new PrismaClient().$extends(withAccelerate()); export default async function Page() { const users = await prisma.user.findMany(); diff --git a/content/300-accelerate/200-getting-started.mdx b/content/300-accelerate/200-getting-started.mdx index 2401e0f1b3..fe5db0fa09 100644 --- a/content/300-accelerate/200-getting-started.mdx +++ b/content/300-accelerate/200-getting-started.mdx @@ -130,9 +130,7 @@ Add the following to extend your existing Prisma Client instance with the Accele import { PrismaClient } from '@prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' -const prisma = new PrismaClient({ - accelerateUrl: process.env.DATABASE_URL, -}).$extends(withAccelerate()) +const prisma = new PrismaClient().$extends(withAccelerate()) ``` If you are going to deploy to an edge runtime (like Cloudflare Workers, Vercel Edge Functions, Deno Deploy, or Supabase Edge Functions), use our edge client instead: @@ -141,9 +139,7 @@ If you are going to deploy to an edge runtime (like Cloudflare Workers, Vercel E import { PrismaClient } from '@prisma/client/edge' import { withAccelerate } from '@prisma/extension-accelerate' -const prisma = new PrismaClient({ - accelerateUrl: process.env.DATABASE_URL, -}).$extends(withAccelerate()) +const prisma = new PrismaClient().$extends(withAccelerate()) ``` If VS Code does not recognize the `$extends` method, refer to [this section](/accelerate/faq#vs-code-does-not-recognize-the-extends-method) on how to resolve the issue. @@ -155,9 +151,7 @@ Since [extensions are applied one after another](/orm/prisma-client/client-exten If you are using [Prisma Optimize](/optimize) in your application, make sure you apply it _before_ the Accelerate extension. For example: ```ts -const prisma = new PrismaClient({ - accelerateUrl: process.env.DATABASE_URL, -}) +const prisma = new PrismaClient() .$extends(withOptimize()) .$extends(withAccelerate()) ``` diff --git a/content/800-guides/300-supabase-accelerate.mdx b/content/800-guides/300-supabase-accelerate.mdx index 55d1e5a48b..1288d71c34 100644 --- a/content/800-guides/300-supabase-accelerate.mdx +++ b/content/800-guides/300-supabase-accelerate.mdx @@ -172,9 +172,7 @@ In your application code, you now need to apply the Accelerate extension to your import { PrismaClient } from "./generated/prisma/client" import { withAccelerate } from "@prisma/extension-accelerate" -const prisma = new PrismaClient({ - accelerateUrl: process.env.DATABASE_URL, -}).$extends(withAccelerate()) +const prisma = new PrismaClient().$extends(withAccelerate()) ``` At this point, you can now start sending queries which will be routed through the connection pool to your database. \ No newline at end of file diff --git a/content/800-guides/310-neon-accelerate.mdx b/content/800-guides/310-neon-accelerate.mdx index 412db34cf9..ac1ae216b2 100644 --- a/content/800-guides/310-neon-accelerate.mdx +++ b/content/800-guides/310-neon-accelerate.mdx @@ -172,9 +172,7 @@ In your application code, you now need to apply the Accelerate extension to your import { PrismaClient } from "./generated/prisma/client" import { withAccelerate } from "@prisma/extension-accelerate" -const prisma = new PrismaClient({ - accelerateUrl: process.env.DATABASE_URL, -}).$extends(withAccelerate()) +const prisma = new PrismaClient().$extends(withAccelerate()) ``` At this point, you can now start sending queries which will be routed through the connection pool to your database. \ No newline at end of file