MVP #141

Merged
flixcoo merged 705 commits from development into main 2026-01-09 12:55:50 +00:00
Showing only changes of commit 9cb35dc4a1 - Show all commits

View File

@@ -65,8 +65,9 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
); );
} }
/// Adds a new [Match] to the database. /// Adds a new [Match] to the database. Also adds players and group
/// Also adds associated players and group if they exist. /// associations. This method assumes that the players and groups added to
/// this match are already present in the database.
Future<void> addMatch({required Match match}) async { Future<void> addMatch({required Match match}) async {
await db.transaction(() async { await db.transaction(() async {
await into(matchTable).insert( await into(matchTable).insert(
@@ -100,6 +101,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
/// Adds multiple [Match]s to the database in a batch operation. /// Adds multiple [Match]s to the database in a batch operation.
/// Also adds associated players and groups if they exist. /// Also adds associated players and groups if they exist.
/// If the [matches] list is empty, the method returns immediately. /// If the [matches] list is empty, the method returns immediately.
/// This Method should only be used to import matches from a different device.
Future<void> addMatchAsList({required List<Match> matches}) async { Future<void> addMatchAsList({required List<Match> matches}) async {
if (matches.isEmpty) return; if (matches.isEmpty) return;
await db.transaction(() async { await db.transaction(() async {