forked from mirrors/gecko-dev
Bug 1890623 - Adds methods to retreive unsent crashes from the database r=android-reviewers,mcarare
Differential Revision: https://phabricator.services.mozilla.com/D211123
This commit is contained in:
parent
aa59c116e7
commit
a3f59dbcea
1 changed files with 26 additions and 0 deletions
|
|
@ -37,6 +37,32 @@ internal interface CrashDao {
|
|||
@Query("SELECT * FROM crashes ORDER BY created_at DESC")
|
||||
fun getCrashesWithReports(): LiveData<List<CrashWithReports>>
|
||||
|
||||
/**
|
||||
* Returns saved crashes that haven't been reported.
|
||||
*/
|
||||
@Transaction
|
||||
@Query(
|
||||
"""
|
||||
SELECT * FROM crashes
|
||||
LEFT JOIN reports ON crashes.uuid = reports.crash_uuid
|
||||
WHERE reports.crash_uuid IS NULL
|
||||
""",
|
||||
)
|
||||
suspend fun getCrashesWithoutReports(): List<CrashEntity>
|
||||
|
||||
/**
|
||||
* Returns saved crashes that haven't been reported.
|
||||
*/
|
||||
@Transaction
|
||||
@Query(
|
||||
"""
|
||||
SELECT COUNT(*) FROM crashes
|
||||
LEFT JOIN reports ON crashes.uuid = reports.crash_uuid
|
||||
WHERE reports.crash_uuid IS NULL
|
||||
""",
|
||||
)
|
||||
suspend fun numberOfUnsentCrashes(): Int
|
||||
|
||||
/**
|
||||
* Delete table.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue