Skip to content

Commit 94518fd

Browse files
update all nextjs examples in generator-prisma-client/ (#8342)
1 parent c233671 commit 94518fd

File tree

46 files changed

+882
-1086
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+882
-1086
lines changed

generator-prisma-client/nextjs-starter-turbopack/README.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@ This project showcases how to use the Prisma ORM with Prisma Postgres in an ESM
44

55
## Prerequisites
66

7-
To successfully run the project, you will need the following:
8-
9-
- Two **Prisma Postgres** connection strings:
10-
- Your **Prisma Postgres + Accelerate connection string** (containing your **Prisma API key**) which you can get by enabling Postgres in a project in your [Prisma Data Platform](https://pris.ly/pdp) account. You will use this connection string to run Prisma migrations.
11-
- Your **Prisma Postgres direct TCP connection string** which you will use with Prisma Client.
12-
Learn more in the [docs](https://www.prisma.io/docs/postgres/database/direct-connections).
7+
To successfully run the project, you will need a **Prisma Postgres** connection string from your [Prisma Data Platform](https://pris.ly/pdp) project.
138

149
## Tech Stack
1510

@@ -25,10 +20,9 @@ To successfully run the project, you will need the following:
2520

2621
```prisma
2722
generator client {
28-
provider = "prisma-client"
29-
output = "../lib/generated/prisma"
30-
previewFeatures = ["driverAdapters", "queryCompiler"]
31-
runtime = "nodejs"
23+
provider = "prisma-client"
24+
output = "../lib/generated/prisma"
25+
engineType = "client"
3226
}
3327
```
3428

@@ -52,23 +46,17 @@ Create a `.env` in the root of the project directory:
5246
touch .env
5347
```
5448

55-
Now, open the `.env` file and set the `DATABASE_URL` environment variables with the values of your connection string and your Prisma Postgres connection string:
49+
Now, open the `.env` file and set the `DATABASE_URL` environment variable with your connection string:
5650

5751
```bash
5852
# .env
5953

60-
# Prisma Postgres connection string (used for migrations)
6154
DATABASE_URL="__YOUR_PRISMA_POSTGRES_CONNECTION_STRING__"
6255

63-
# Postgres connection string (used for queries by Prisma Client)
64-
DIRECT_URL="__YOUR_PRISMA_POSTGRES_DIRECT_CONNECTION_STRING__"
65-
6656
NEXT_PUBLIC_URL="http://localhost:3000"
6757
```
6858

69-
Note that `__YOUR_PRISMA_POSTGRES_CONNECTION_STRING__` is a placeholder value that you need to replace with the values of your Prisma Postgres + Accelerate connection string. Notice that the Accelerate connection string has the following structure: `prisma+postgres://accelerate.prisma-data.net/?api_key=<api_key_value>`.
70-
71-
Note that `__YOUR_PRISMA_POSTGRES_DIRECT_CONNECTION_STRING__` is a placeholder value that you need to replace with the values of your Prisma Postgres direct TCP connection string. The direct connection string has the following structure: `postgres://<username>:<password>@<host>:<port>/<database>`.
59+
Replace `__YOUR_PRISMA_POSTGRES_CONNECTION_STRING__` with your actual Prisma Postgres connection string.
7260

7361
### 3. Generate Prisma Client
7462

generator-prisma-client/nextjs-starter-turbopack/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Inter } from 'next/font/google'
55
const inter = Inter({ subsets: ['latin'] })
66

77
export const metadata: Metadata = {
8-
title: 'Accelerated Quotes',
9-
description: 'Accelerate starter',
8+
title: 'Quotes',
9+
description: 'Starter',
1010
}
1111

1212
export default function RootLayout({
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from "eslint/config";
2+
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
6+
const __filename = fileURLToPath(import.meta.url);
7+
const __dirname = path.dirname(__filename);
8+
9+
export default defineConfig([{
10+
extends: [...nextCoreWebVitals],
11+
}]);

generator-prisma-client/nextjs-starter-turbopack/lib/db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export function getDb({ connectionString }: GetDbParams) {
1313
return prisma
1414
}
1515

16-
const prisma = getDb({ connectionString: env.DIRECT_URL })
16+
const prisma = getDb({ connectionString: env.DATABASE_URL })
1717
export default prisma

generator-prisma-client/nextjs-starter-turbopack/lib/env/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { z } from 'zod'
33

44
export const env = createEnv({
55
server: {
6-
DIRECT_URL: z.string().url().startsWith('postgres://'),
6+
DATABASE_URL: z.string().url().startsWith('postgresql://'),
77
},
88
runtimeEnv: process.env,
99
})

generator-prisma-client/nextjs-starter-turbopack/package.json

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,32 +21,38 @@
2121
"dev": "next dev --turbopack",
2222
"build": "prisma generate && next build --turbopack",
2323
"start": "next start",
24-
"lint": "next lint"
24+
"lint": "eslint ."
2525
},
2626
"dependencies": {
27-
"@prisma/adapter-pg": "6.14.0",
28-
"@prisma/client": "6.14.0",
27+
"@prisma/adapter-pg": "6.18.0",
28+
"@prisma/client": "6.18.0",
2929
"@t3-oss/env-core": "0.13.8",
30-
"next": "15.3.5",
30+
"next": "16.0.1",
3131
"postcss": "8.5.6",
32-
"react": "19.1.0",
33-
"react-dom": "19.1.0",
32+
"react": "19.2.0",
33+
"react-dom": "19.2.0",
3434
"react-hot-toast": "2.5.2",
3535
"tailwindcss": "3.4.17",
3636
"zod": "3.25.76"
3737
},
3838
"devDependencies": {
3939
"@types/node": "22.18.12",
40-
"@types/react": "19.1.8",
41-
"@types/react-dom": "19.1.6",
40+
"@types/react": "19.2.2",
41+
"@types/react-dom": "19.2.2",
4242
"autoprefixer": "10.4.21",
4343
"dotenv": "17.2.1",
44-
"eslint": "8.57.1",
45-
"eslint-config-next": "15.3.5",
46-
"prisma": "6.14.0",
44+
"eslint": "^9",
45+
"eslint-config-next": "16.0.1",
46+
"prisma": "6.18.0",
4747
"tsx": "4.20.6",
4848
"typescript": "5.8.3"
4949
},
5050
"license": "MIT",
51-
"packageManager": "[email protected]+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81"
51+
"packageManager": "[email protected]+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81",
52+
"pnpm": {
53+
"overrides": {
54+
"@types/react": "19.2.2",
55+
"@types/react-dom": "19.2.2"
56+
}
57+
}
5258
}

0 commit comments

Comments
 (0)