Add Delete for Me sync support.

This commit is contained in:
Cody Henthorne
2024-05-21 15:11:06 -04:00
parent 1c66da7873
commit a81a675d59
40 changed files with 2274 additions and 198 deletions

View File

@@ -79,11 +79,15 @@ fun <T> Cursor.requireObject(column: String, serializer: IntSerializer<T>): T {
@JvmOverloads
fun Cursor.readToSingleLong(defaultValue: Long = 0): Long {
return readToSingleLongOrNull() ?: defaultValue
}
fun Cursor.readToSingleLongOrNull(): Long? {
return use {
if (it.moveToFirst()) {
it.getLong(0)
it.getLongOrNull(0)
} else {
defaultValue
null
}
}
}