-
Notifications
You must be signed in to change notification settings - Fork 464
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,8 @@ | ||
| import 'dotenv/config' | ||
| import { styleText } from 'node:util' | ||
| import { remember } from '@epic-web/remember' | ||
| // Changed import due to issue: https://github.com/remix-run/react-router/pull/12644 | ||
| import { PrismaClient } from '@prisma/client/index.js' | ||
| import { PrismaClient } from '../../prisma/generated/client' | ||
| import { PrismaBetterSQLite3 } from "@prisma/adapter-better-sqlite3" | ||
|
|
||
| export const prisma = remember('prisma', () => { | ||
| // NOTE: if you change anything in this function you'll need to restart | ||
|
|
@@ -10,7 +11,9 @@ export const prisma = remember('prisma', () => { | |
| // 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 }) | ||
|
||
| const client = new PrismaClient({ | ||
| adapter, | ||
| log: [ | ||
| { level: 'query', emit: 'event' }, | ||
| { level: 'error', emit: 'stdout' }, | ||
|
|
||
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
importsconfig inpackage.jsonso 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 ✅