feat: GamePrisma를 사용하여 데이터베이스 클라이언트 및 관련 타입 정의 업데이트

This commit is contained in:
2026-01-05 15:13:59 +00:00
parent c3b6833172
commit b1f2523fa3
7 changed files with 47 additions and 216 deletions
+12 -88
View File
@@ -1,89 +1,13 @@
export interface DatabaseClient<
WorldStateRow = unknown,
GeneralRow = unknown,
CityRow = unknown,
NationRow = unknown,
GeneralTurnRow = unknown,
NationTurnRow = unknown,
TroopRow = unknown
> {
$transaction<T = unknown>(
queries: Array<Promise<T>>
): Promise<T[]>;
$queryRaw<T = unknown>(
query: TemplateStringsArray,
...values: unknown[]
): Promise<T>;
worldState: {
findFirst(args?: unknown): Promise<WorldStateRow | null>;
};
general: {
findUnique(args: { where: { id: number } }): Promise<GeneralRow | null>;
findFirst(args: {
where: { userId?: string; npcState?: number | { gt: number } };
select?: { name?: boolean; picture?: boolean };
}): Promise<GeneralRow | null>;
findMany(args: {
where?: { nationId?: number };
}): Promise<GeneralRow[]>;
count(args?: {
where?: { npcState?: number | { gt: number } };
}): Promise<number>;
update(args: {
where: { id: number };
data: Partial<GeneralRow>;
}): Promise<GeneralRow>;
updateMany(args: {
where: { troopId?: number };
data: Partial<GeneralRow>;
}): Promise<unknown>;
};
city: {
findUnique(args: { where: { id: number } }): Promise<CityRow | null>;
};
nation: {
findUnique(args: { where: { id: number } }): Promise<NationRow | null>;
count(args?: { where?: { level?: { gt: number } } }): Promise<number>;
};
generalTurn: {
findMany(args: {
where: { generalId: number };
orderBy?: { turnIdx: 'asc' | 'desc' }[];
}): Promise<GeneralTurnRow[]>;
deleteMany(args: { where: { generalId: number } }): Promise<unknown>;
createMany(args: {
data: Array<{
generalId: number;
turnIdx: number;
actionCode: string;
arg: unknown;
}>;
}): Promise<unknown>;
};
nationTurn: {
findMany(args: {
where: { nationId: number; officerLevel: number };
orderBy?: { turnIdx: 'asc' | 'desc' }[];
}): Promise<NationTurnRow[]>;
deleteMany(args: {
where: { nationId: number; officerLevel: number };
}): Promise<unknown>;
createMany(args: {
data: Array<{
nationId: number;
officerLevel: number;
turnIdx: number;
actionCode: string;
arg: unknown;
}>;
}): Promise<unknown>;
};
troop: {
findUnique(args: {
where: { troopLeaderId: number };
}): Promise<TroopRow | null>;
deleteMany(args: {
where: { troopLeaderId: number };
}): Promise<unknown>;
};
import type { GamePrisma, GamePrismaClient } from './gamePrisma.js';
export interface DatabaseClient {
$transaction: GamePrismaClient['$transaction'];
$queryRaw: GamePrismaClient['$queryRaw'];
worldState: GamePrisma.WorldStateDelegate;
general: GamePrisma.GeneralDelegate;
city: GamePrisma.CityDelegate;
nation: GamePrisma.NationDelegate;
generalTurn: GamePrisma.GeneralTurnDelegate;
nationTurn: GamePrisma.NationTurnDelegate;
troop: GamePrisma.TroopDelegate;
}