File tree Expand file tree Collapse file tree 17 files changed +1263
-51
lines changed
Expand file tree Collapse file tree 17 files changed +1263
-51
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 66 "author" : " " ,
77 "main" : " index.js" ,
88 "scripts" : {
9- "start" : " ts-node ./src/script.ts" ,
9+ "start" : " tsx ./src/script.ts" ,
1010 "test" : " jest" ,
1111 "test:watch" : " jest --watch"
1212 },
1313 "dependencies" : {
14- "@prisma/client" : " 6.9.0" ,
14+ "@prisma/adapter-pg" : " 6.20.0-integration-next.3" ,
15+ "@prisma/client" : " 6.20.0-integration-next.3" ,
16+ "dotenv" : " 16.6.1" ,
1517 "jest" : " 29.7.0"
1618 },
1719 "devDependencies" : {
1820 "@types/jest" : " 29.5.14" ,
1921 "@types/node" : " 22.19.0" ,
2022 "@types/prettyjson" : " 0.0.33" ,
2123 "prettyjson" : " 1.2.5" ,
22- "prisma" : " 6.9.0 " ,
24+ "prisma" : " 6.20.0-integration-next.3 " ,
2325 "ts-jest" : " 29.4.5" ,
24- "ts-node" : " 10.9.2" ,
25- "ts-node-dev" : " 2.0.0" ,
26+ "tsx" : " ^4.20.6" ,
2627 "typescript" : " 5.8.2"
2728 }
28- }
29+ }
Original file line number Diff line number Diff line change 11generator client {
2- provider = " prisma-client-js "
2+ provider = " prisma-client "
3+ output = " ./generated "
4+ engineType = " client "
35}
46
57datasource db {
@@ -25,7 +27,7 @@ model Post {
2527 authorId String
2628 author User @relation (fields : [authorId ] , references : [id ] )
2729 comments Comment []
28- tags Tag []
30+ tags Tag []
2931}
3032
3133model Comment {
Original file line number Diff line number Diff line change 1- import { PrismaClient } from '@ prisma/client'
1+ import { PrismaClient } from '../ prisma/generated /client'
22import prettyjson from 'prettyjson'
3+ import { PrismaPg } from '@prisma/adapter-pg'
4+ import 'dotenv/config'
35
4- const prisma = new PrismaClient ( )
6+ const adapter = new PrismaPg ( {
7+ connectionString : process . env . DATABASE_URL ,
8+ } )
9+ const prisma = new PrismaClient ( {
10+ adapter,
11+ } )
512
613// A `main` function so that we can use async/await
714async function main ( ) {
Original file line number Diff line number Diff line change 1- import { PrismaClient } from '@prisma/client'
1+ import { PrismaClient } from '../prisma/generated/client'
2+ import { PrismaPg } from '@prisma/adapter-pg'
3+ import 'dotenv/config'
24
3- export const prisma = new PrismaClient ( )
5+ const adapter = new PrismaPg ( {
6+ connectionString : process . env . DATABASE_URL ,
7+ } )
8+ export const prisma = new PrismaClient ( {
9+ adapter,
10+ } )
411
512describe ( 'example test with Prisma Client' , ( ) => {
613 beforeAll ( async ( ) => {
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "license" : " MIT" ,
55 "scripts" : {
6- "dev" : " ts-node script.ts" ,
6+ "dev" : " tsx script.ts" ,
77 "test" : " jest" ,
88 "test:watch" : " jest --watch"
99 },
1010 "devDependencies" : {
11- "@types/node" : " 22.19.0 " ,
12- "prisma" : " 6.9.0 " ,
11+ "@types/node" : " 22.18.12 " ,
12+ "prisma" : " 6.20.0-integration-next.3 " ,
1313 "supabase" : " 2.30.4" ,
14- "ts-node " : " 10.9 .2" ,
15- "typescript " : " 5.8.2 "
14+ "typescript " : " 5.8 .2" ,
15+ "tsx " : " ^4.20.6 "
1616 },
1717 "dependencies" : {
18- "@prisma/client" : " 6.9.0"
19- },
20- "prisma" : {
21- "seed" : " ts-node prisma/seed.ts"
18+ "@prisma/adapter-pg" : " 6.20.0-integration-next.3" ,
19+ "@prisma/client" : " 6.20.0-integration-next.3"
2220 }
23- }
21+ }
Original file line number Diff line number Diff line change 1+ import "dotenv/config" ;
2+ import { defineConfig , env } from "prisma/config" ;
3+
4+ export default defineConfig ( {
5+ schema : "prisma/schema.prisma" ,
6+ migrations : {
7+ path : "prisma/migrations" ,
8+ } ,
9+ datasource : {
10+ url : env ( "DATABASE_URL" ) ,
11+ } ,
12+ } ) ;
Original file line number Diff line number Diff line change 22// learn more about it in the docs: https://pris.ly/d/prisma-schema
33
44generator client {
5- provider = " prisma-client-js "
5+ provider = " prisma-client "
6+ output = " ./generated "
7+ engineType = " client "
68}
79
810datasource db {
9- provider = " postgresql "
10- url = env (" DATABASE_URL " )
11+ provider = " postgresql "
12+ url = env (" DATABASE_URL " )
1113}
1214
1315model User {
Original file line number Diff line number Diff line change 1- import { PrismaClient , Prisma } from '@prisma/client'
1+ import { PrismaClient , Prisma } from './generated/client'
2+ import { PrismaPg } from "@prisma/adapter-pg"
23
3- const prisma = new PrismaClient ( ) ;
4+ const adapter = new PrismaPg ( {
5+ connectionString : process . env . DATABASE_URL ,
6+ } )
7+ const prisma = new PrismaClient ( {
8+ adapter,
9+ } ) ;
410
511const userData = [
612 {
You can’t perform that action at this time.
0 commit comments