sendou.ink/app/features/tournament-bracket/queries/insertTournamentMatchGameResult.server.ts
Kalle c0ec15b7de
Some checks failed
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled
Unify db type files
2025-03-21 21:47:08 +02:00

17 lines
614 B
TypeScript

import { sql } from "~/db/sql";
import type { Tables } from "~/db/tables";
const stm = sql.prepare(/* sql */ `
insert into "TournamentMatchGameResult"
("matchId", "stageId", "mode", "winnerTeamId", "reporterId", "number", "source", "opponentOnePoints", "opponentTwoPoints")
values
(@matchId, @stageId, @mode, @winnerTeamId, @reporterId, @number, @source, @opponentOnePoints, @opponentTwoPoints)
returning *
`);
export function insertTournamentMatchGameResult(
args: Omit<Tables["TournamentMatchGameResult"], "id" | "createdAt">,
) {
return stm.get(args) as Tables["TournamentMatchGameResult"];
}