-
Notifications
You must be signed in to change notification settings - Fork 463
update prisma #1059
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?
update prisma #1059
Conversation
app/routes/users/index.tsx
Outdated
| @@ -1,4 +1,4 @@ | |||
| import { searchUsers } from '@prisma/client/sql' | |||
| import { searchUsers } from '../../../prisma/generated/sql' | |||
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.
Let's put this in the imports config in package.json so we don't need to worry about ../../...
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.
Done ✅
app/utils/db.server.ts
Outdated
| // Feel free to change this log threshold to something that makes sense for you | ||
| const logThreshold = 20 | ||
|
|
||
| const adapter = new PrismaBetterSQLite3({ url: 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.
Bug: Prisma Adapter: Mismatched Connection Type
The PrismaBetterSQLite3 adapter is initialized with { url: process.env.DATABASE_URL }, but this adapter requires a better-sqlite3 Database instance, not a URL string. The adapter expects an already-instantiated database connection from the better-sqlite3 package. This will cause a runtime error when the application tries to connect to the database.
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, my friend cursor its fine :)
|
Currently it’s using a preview build of Prisma. You can try it out and let me know if everything works fine. |
|
Awesome! I think I'll hold off until v7 is released. I think it's pretty close! |
Note
Upgrades Prisma to 6.19 with a generated client/typed SQL, adds the Better SQLite3 adapter, and updates codebase imports/config accordingly.
prisma-clientwith output inprisma/generatedand enabletypedSqlinprisma/schema.prisma.prisma.config.ts(schema, migrations path/seed, classic engine,DATABASE_URL).PrismaBetterSQLite3and load env inapp/utils/db.server.ts.#prisma/generated/client.tsand#prisma/generated/sql.ts; add#prisma/*path alias inpackage.jsonand ignoreprisma/generatedin.gitignore.^6.19.0; add@prisma/adapter-better-sqlite3.app/routes/users/index.tsx: use typed SQL viasearchUsers.#prisma/generated/client.ts.Written by Cursor Bugbot for commit 9ee75dc. This will update automatically on new commits. Configure here.