@@ -6,8 +6,10 @@ const prismaRootSchema = `// This is your Prisma schema file,
66// learn more about it in the docs: https://pris.ly/d/prisma-schema
77
88generator client {
9- provider = "prisma-client-js"
10- previewFeatures = ["prismaSchemaFolder"]
9+ provider = "prisma-client"
10+ output = "./client"
11+
12+ engineType = "library"
1113}
1214
1315datasource db {
@@ -49,7 +51,8 @@ const prismaExampleEndpoint = `/**
4951export default defineEventHandler(event => event.context.prisma.example.findMany())
5052`
5153
52- const prismaServerMiddleware = `import { PrismaClient } from '@prisma/client'
54+ const prismaServerMiddleware = `import { PrismaPg } from '@prisma/adapter-pg'
55+ import { PrismaClient } from '@prisma/client'
5356
5457let prisma: PrismaClient
5558
@@ -61,7 +64,8 @@ declare module 'h3' {
6164
6265export default eventHandler((event) => {
6366 if (!prisma) {
64- prisma = new PrismaClient()
67+ const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL })
68+ prisma = new PrismaClient({ adapter })
6569 }
6670 event.context.prisma = prisma
6771})
@@ -166,33 +170,33 @@ const prisma: ModuleConfig = {
166170 scripts : [
167171 {
168172 name : 'db' ,
169- command : 'vite- node prisma/pglite.ts' ,
173+ command : 'node prisma/pglite.ts' ,
170174 }
171175 ] ,
172176 dependencies : [
173177 {
174178 name : 'prisma' ,
175- version : '^5.22.0 ' ,
179+ version : '^6.16.3 ' ,
176180 isDev : true
177181 } ,
178182 {
179183 name : '@prisma/client' ,
180- version : '^5.22.0 ' ,
184+ version : '^6.16.3 ' ,
181185 isDev : false
182186 } ,
187+ {
188+ name : '@prisma/adapter-pg' ,
189+ version : '^6.16.3' ,
190+ isDev : false ,
191+ } ,
183192 {
184193 name : '@electric-sql/pglite' ,
185194 version : '0.2.13' ,
186195 isDev : true ,
187196 } ,
188197 {
189198 name : 'pg-gateway' ,
190- version : '0.3.0-beta.3' ,
191- isDev : true ,
192- } ,
193- {
194- name : 'vite-node' ,
195- version : '^2.1.5' ,
199+ version : '0.3.0-beta.4' ,
196200 isDev : true ,
197201 }
198202 ] ,
@@ -219,7 +223,7 @@ const prisma: ModuleConfig = {
219223 content : prismaServerMiddleware
220224 } ,
221225 {
222- path : 'components/Welcome/PrismaDemo.vue' ,
226+ path : 'app/ components/Welcome/PrismaDemo.vue' ,
223227 content : prismaDemoComponent ,
224228 } ,
225229 {
0 commit comments