mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 21:15:48 +00:00
Add support for PniSignatureMessages.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user