Skip to content

Commit f5102cf

Browse files
update prisma
1 parent 97135fc commit f5102cf

File tree

10 files changed

+691
-68
lines changed

10 files changed

+691
-68
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ node_modules
99
/prisma/data.db
1010
/prisma/data.db-journal
1111
/tests/prisma
12+
/prisma/generated
1213

1314
/test-results/
1415
/playwright-report/

app/routes/users/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { searchUsers } from '@prisma/client/sql'
1+
import { searchUsers } from '../../../prisma/generated/sql'
22
import { Img } from 'openimg/react'
33
import { redirect, Link } from 'react-router'
44
import { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'

app/utils/auth.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import crypto from 'node:crypto'
2-
import { type Connection, type Password, type User } from '@prisma/client'
2+
import { type Connection, type Password, type User } from '../../prisma/generated/client'
33
import bcrypt from 'bcryptjs'
44
import { redirect } from 'react-router'
55
import { Authenticator } from 'remix-auth'

app/utils/db.server.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import 'dotenv/config'
12
import { styleText } from 'node:util'
23
import { remember } from '@epic-web/remember'
3-
// Changed import due to issue: https://github.com/remix-run/react-router/pull/12644
4-
import { PrismaClient } from '@prisma/client/index.js'
4+
import { PrismaClient } from '../../prisma/generated/client'
5+
import { PrismaBetterSQLite3 } from "@prisma/adapter-better-sqlite3"
56

67
export const prisma = remember('prisma', () => {
78
// NOTE: if you change anything in this function you'll need to restart
@@ -10,7 +11,9 @@ export const prisma = remember('prisma', () => {
1011
// Feel free to change this log threshold to something that makes sense for you
1112
const logThreshold = 20
1213

14+
const adapter = new PrismaBetterSQLite3({ url: process.env.DATABASE_URL })
1315
const client = new PrismaClient({
16+
adapter,
1417
log: [
1518
{ level: 'query', emit: 'event' },
1619
{ level: 'error', emit: 'stdout' },

0 commit comments

Comments
 (0)