Added methods for inserting games and groups into the db

This commit is contained in:
2025-11-12 12:04:33 +01:00
parent b6700bafd9
commit d07943add9
5 changed files with 58 additions and 5 deletions

View File

@@ -37,4 +37,12 @@ class PlayerGameDao extends DatabaseAccessor<AppDatabase>
final players = await Future.wait(futures);
return players.whereType<Player>().toList();
}
/// Associates a player with a game by inserting a record into the
/// [PlayerGameTable].
Future<void> addPlayerToGame(String gameId, String playerId) async {
await into(playerGameTable).insert(
PlayerGameTableCompanion.insert(playerId: playerId, gameId: gameId),
);
}
}