chore: SQLite verwijderd — alleen PostgreSQL via Neon
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ffe3815598
commit
b541379964
10 changed files with 26 additions and 811 deletions
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
## lib/prisma.ts
|
||||
|
||||
Detecteert automatisch SQLite (lokaal, `file:`) of PostgreSQL (Neon/Vercel).
|
||||
PostgreSQL via `pg` + `@prisma/adapter-pg` (Neon/Vercel).
|
||||
|
||||
```ts
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3'
|
||||
import { Pool } from 'pg'
|
||||
import { PrismaPg } from '@prisma/adapter-pg'
|
||||
|
||||
|
|
@ -14,14 +13,6 @@ function createPrismaClient() {
|
|||
const url = process.env.DATABASE_URL
|
||||
if (!url) throw new Error('DATABASE_URL is not set')
|
||||
|
||||
if (url.startsWith('file:')) {
|
||||
const adapter = new PrismaBetterSqlite3({ url })
|
||||
return new PrismaClient({
|
||||
adapter,
|
||||
log: process.env.NODE_ENV === 'development' ? ['error', 'warn'] : ['error'],
|
||||
})
|
||||
}
|
||||
|
||||
const pool = new Pool({ connectionString: url })
|
||||
const adapter = new PrismaPg(pool)
|
||||
return new PrismaClient({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue