mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
24 lines
544 B
TypeScript
24 lines
544 B
TypeScript
import { PrismaClient } from '@prisma/client';
|
|
|
|
// Initialize Prisma Client
|
|
// Log queries in development for debugging
|
|
export const prisma = new PrismaClient({
|
|
log:
|
|
process.env.NODE_ENV === 'development'
|
|
? ['query', 'info', 'warn', 'error']
|
|
: ['error'],
|
|
});
|
|
|
|
// Re-export types for convenience
|
|
export type {
|
|
User,
|
|
Operation,
|
|
UserSyncState,
|
|
SyncDevice,
|
|
Tombstone,
|
|
} from '@prisma/client';
|
|
|
|
// Helper to disconnect on shutdown
|
|
export const disconnectDb = async (): Promise<void> => {
|
|
await prisma.$disconnect();
|
|
};
|