diff --git a/mobile/lib/face/db.dart b/mobile/lib/face/db.dart index f054ebf65..53a3a22e8 100644 --- a/mobile/lib/face/db.dart +++ b/mobile/lib/face/db.dart @@ -146,8 +146,8 @@ class FaceMLDataDB { } Future> clusterIdToFaceCount() async { - final db = await instance.database; - final List> maps = await db.rawQuery( + final db = await instance.sqliteAsyncDB; + final List> maps = await db.getAll( 'SELECT $fcClusterID, COUNT(*) as count FROM $faceClustersTable where $fcClusterID IS NOT NULL GROUP BY $fcClusterID ', ); final Map result = {}; @@ -158,15 +158,15 @@ class FaceMLDataDB { } Future> getPersonIgnoredClusters(String personID) async { - final db = await instance.database; + final db = await instance.sqliteAsyncDB; // find out clusterIds that are assigned to other persons using the clusters table - final List> maps = await db.rawQuery( + final List> maps = await db.getAll( 'SELECT $clusterIDColumn FROM $clusterPersonTable WHERE $personIdColumn != ? AND $personIdColumn IS NOT NULL', [personID], ); final Set ignoredClusterIDs = maps.map((e) => e[clusterIDColumn] as int).toSet(); - final List> rejectMaps = await db.rawQuery( + final List> rejectMaps = await db.getAll( 'SELECT $clusterIDColumn FROM $notPersonFeedback WHERE $personIdColumn = ?', [personID], ); @@ -176,8 +176,8 @@ class FaceMLDataDB { } Future> getPersonClusterIDs(String personID) async { - final db = await instance.database; - final List> maps = await db.rawQuery( + final db = await instance.sqliteAsyncDB; + final List> maps = await db.getAll( 'SELECT $clusterIDColumn FROM $clusterPersonTable WHERE $personIdColumn = ?', [personID], );