feat: initialize Prisma client with better-sqlite3 adapter

This commit is contained in:
Michael committed 2026-04-10 11:23:54 +02:00
1 parent eff3d0402d
commit 7cefa5852a
2 files changed
+5 -5

No files matched your search

+3 -5
View File
@@ -116,15 +116,13 @@ export default async function AdminPage() {
}}>
<button type="submit" style={{
background: 'transparent',
color: 'rgba(255,255,255,0.25)',
color: 'rgba(255,255,255,0.3)',
padding: '0.4rem',
borderRadius: '8px',
flexShrink: 0,
transition: 'color 200ms',
}}
onMouseEnter={(e) => (e.currentTarget.style.color = '#ff6b7a')}
onMouseLeave={(e) => (e.currentTarget.style.color = 'rgba(255,255,255,0.25)')}
>
cursor: 'pointer',
}}>
<Trash2 size={16} />
</button>
</form>
+2
View File
@@ -10,6 +10,8 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
const createPrismaClient = () => {
const dbUrl = process.env.DATABASE_URL || 'file:/app/prisma/dev.db';
console.log(`[DB] Connecting to: ${dbUrl}`);
// Wrap with the Prisma driver adapter
const adapter = new PrismaBetterSqlite3({ url: dbUrl });
return new PrismaClient({ adapter });
};