mirror of
https://github.com/R0m1k3/Menu.git
synced 2026-10-11 17:28:28 +02:00
feat: initialize Prisma client with better-sqlite3 adapter
This commit is contained in:
1 parent
eff3d0402d
commit
7cefa5852a
2 files changed
+5
-5
No files matched your search
+3
-5
@@ -116,15 +116,13 @@ export default async function AdminPage() {
|
|||||||
}}>
|
}}>
|
||||||
<button type="submit" style={{
|
<button type="submit" style={{
|
||||||
background: 'transparent',
|
background: 'transparent',
|
||||||
color: 'rgba(255,255,255,0.25)',
|
color: 'rgba(255,255,255,0.3)',
|
||||||
padding: '0.4rem',
|
padding: '0.4rem',
|
||||||
borderRadius: '8px',
|
borderRadius: '8px',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
transition: 'color 200ms',
|
transition: 'color 200ms',
|
||||||
}}
|
cursor: 'pointer',
|
||||||
onMouseEnter={(e) => (e.currentTarget.style.color = '#ff6b7a')}
|
}}>
|
||||||
onMouseLeave={(e) => (e.currentTarget.style.color = 'rgba(255,255,255,0.25)')}
|
|
||||||
>
|
|
||||||
<Trash2 size={16} />
|
<Trash2 size={16} />
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ const globalForPrisma = global as unknown as { prisma: PrismaClient };
|
|||||||
const createPrismaClient = () => {
|
const createPrismaClient = () => {
|
||||||
const dbUrl = process.env.DATABASE_URL || 'file:/app/prisma/dev.db';
|
const dbUrl = process.env.DATABASE_URL || 'file:/app/prisma/dev.db';
|
||||||
console.log(`[DB] Connecting to: ${dbUrl}`);
|
console.log(`[DB] Connecting to: ${dbUrl}`);
|
||||||
|
|
||||||
|
// Wrap with the Prisma driver adapter
|
||||||
const adapter = new PrismaBetterSqlite3({ url: dbUrl });
|
const adapter = new PrismaBetterSqlite3({ url: dbUrl });
|
||||||
return new PrismaClient({ adapter });
|
return new PrismaClient({ adapter });
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user