Add support for PniSignatureMessages.

This commit is contained in:
Greyson Parrelli
2022-08-24 18:16:42 -04:00
committed by GitHub
parent 1e499fd12f
commit 61498037f3
29 changed files with 602 additions and 210 deletions

View File

@@ -34,6 +34,15 @@ fun SupportSQLiteDatabase.getTableRowCount(table: String): Int {
}
}
/**
* Checks if a row exists that matches the query.
*/
fun SupportSQLiteDatabase.exists(table: String, query: String, vararg args: Any): Boolean {
return this.query("SELECT EXISTS(SELECT 1 FROM $table WHERE $query)", SqlUtil.buildArgs(*args)).use { cursor ->
cursor.moveToFirst() && cursor.getInt(0) == 1
}
}
/**
* Begins a SELECT statement with a helpful builder pattern.
*/