feat: refactor database client types and update related logic across game engine modules

This commit is contained in:
2025-12-30 12:40:55 +00:00
parent 4de688d642
commit cc78319948
10 changed files with 560 additions and 117 deletions
+13 -4
View File
@@ -1,14 +1,23 @@
import { Prisma, PrismaClient } from '@prisma/client';
import { PrismaClient } from '@prisma/client';
import { PrismaPg } from '@prisma/adapter-pg';
import { Pool } from 'pg';
export type PostgresLogLevel = 'query' | 'info' | 'warn' | 'error';
export type PostgresLogOption =
| PostgresLogLevel
| {
emit: 'stdout' | 'event';
level: PostgresLogLevel;
};
export interface PostgresConfig {
url: string;
log?: Prisma.PrismaClientOptions['log'];
log?: PostgresLogOption[];
}
export interface PostgresConnector {
readonly prisma: PrismaClient;
export interface PostgresConnector<TClient = unknown> {
readonly prisma: TClient;
connect(): Promise<void>;
disconnect(): Promise<void>;
}