export async function dbCreateSheet(user: number, match: number) {
const db = db('');
const existing = await db.select('id').from("sheet").where(({user: user, match: match}));
if (existing.length > 0) {
throw new OperationalError("Sheet already existing")
}
const query = db.insert({
user: user,
match: match,
}).into("scoring_sheet");
if (db.client.driverName === "sqlite3") {
await query;
return (await db.select("id").from("scoring_sheet").where({user: user, match: match}))[0].id;