Skip to content

Conversation

@AmanVarshney01
Copy link

@AmanVarshney01 AmanVarshney01 commented Nov 6, 2025


Note

Upgrades Prisma to 6.19 with a generated client/typed SQL, adds the Better SQLite3 adapter, and updates codebase imports/config accordingly.

  • Prisma upgrade & config
    • Switch generator to prisma-client with output in prisma/generated and enable typedSql in prisma/schema.prisma.
    • Introduce prisma.config.ts (schema, migrations path/seed, classic engine, DATABASE_URL).
    • Add Better SQLite3 adapter: use PrismaBetterSQLite3 and load env in app/utils/db.server.ts.
    • Update imports to #prisma/generated/client.ts and #prisma/generated/sql.ts; add #prisma/* path alias in package.json and ignore prisma/generated in .gitignore.
  • Dependencies
    • Bump Prisma packages to ^6.19.0; add @prisma/adapter-better-sqlite3.
  • App/tests
    • app/routes/users/index.tsx: use typed SQL via searchUsers.
    • Tests updated to import Prisma types from #prisma/generated/client.ts.

Written by Cursor Bugbot for commit 9ee75dc. This will update automatically on new commits. Configure here.

@@ -1,4 +1,4 @@
import { searchUsers } from '@prisma/client/sql'
import { searchUsers } from '../../../prisma/generated/sql'
Copy link
Member

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 ../../...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✅

@kentcdodds kentcdodds marked this pull request as ready for review November 11, 2025 19:01
// 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 })
Copy link

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.

Fix in Cursor Fix in Web

Copy link
Author

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 :)

@AmanVarshney01
Copy link
Author

Currently it’s using a preview build of Prisma. You can try it out and let me know if everything works fine.
The only change needed for Prisma 7 now is updating the dependencies to 7.0.0 😄

@kentcdodds
Copy link
Member

Awesome! I think I'll hold off until v7 is released. I think it's pretty close!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants