-
Notifications
You must be signed in to change notification settings - Fork 23
Upgrade to prisma v7 #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Upgrade to prisma v7 #104
Conversation
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "jsx": "preserve", | ||
| "jsx": "react-jsx", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this happened automatically, is it correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no idea
| generator client { | ||
| provider = "prisma-client-js" | ||
| provider = "prisma-client" | ||
| output = "generated" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any better idea for an output path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine
|
|
||
| # turbo | ||
| .turbo | ||
| packages/db/prisma/generated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's quite many files, but should usually be checked in to git. How about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checked in hmmm no I wouldn't, same for the https://www.npmjs.com/package/prisma-client-types-generator we've made, I do not check generated types in
| import { PrismaPg } from "@prisma/adapter-pg"; | ||
| import { readReplicas } from "@prisma/extension-read-replicas"; | ||
|
|
||
| const adapter = new PrismaPg({ connectionString: process.env.DATABASE_URL }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, PrismaPg does indeed have slightly more flexibility, what was your reason for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or is the adapter required now?
| if (process.env.NODE_ENV !== "production") global.prismaClient = prismaClient; | ||
|
|
||
| export const prismaReadClient = prismaClient | ||
| export const prismaReadClient = new PrismaClient({ adapter }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmmh, I think it should extend the primary client, unless things have changed?
| "prisma": "^6.8.2", | ||
| "tsup": "^8.4.0", | ||
| "typescript": "^5.8.3" | ||
| "dotenv": "^17.2.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is prisma not coming with it anymore?
| datasource: { | ||
| url: env("DATABASE_URL"), | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome
| "dependencies": { | ||
| "axios": "^1.13.2", | ||
| "deverything": "^4.2.1" | ||
| "deverything": "^4.5.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
Prisma v7 brings a few breaking changes:
https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7
@prisma/extension-read-replicas throws as error: Error [PrismaClientConstructorValidationError]: Unknown property datasourceUrl provided to PrismaClient constructor.
should we increase the peer dependency?