mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Update more libraries.
This commit is contained in:
@@ -120,7 +120,7 @@ fun SupportSQLiteDatabase.getForeignKeys(): List<ForeignKeyConstraint> {
|
||||
}
|
||||
|
||||
fun SupportSQLiteDatabase.areForeignKeyConstraintsEnabled(): Boolean {
|
||||
return this.query("PRAGMA foreign_keys", null).use { cursor ->
|
||||
return this.query("PRAGMA foreign_keys", arrayOf()).use { cursor ->
|
||||
cursor.moveToFirst() && cursor.getInt(0) != 0
|
||||
}
|
||||
}
|
||||
@@ -508,7 +508,7 @@ class ExistsBuilderPart1(
|
||||
}
|
||||
|
||||
fun run(): Boolean {
|
||||
return db.query("SELECT EXISTS(SELECT 1 FROM $tableName)", null).use { cursor ->
|
||||
return db.query("SELECT EXISTS(SELECT 1 FROM $tableName)", arrayOf()).use { cursor ->
|
||||
cursor.moveToFirst() && cursor.getInt(0) == 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ object SqlUtil {
|
||||
* IMPORTANT: Due to how connection pooling is handled in the app, the only way to have this return useful numbers is to call it within a transaction.
|
||||
*/
|
||||
fun getTotalChanges(db: SupportSQLiteDatabase): Long {
|
||||
return db.query("SELECT total_changes()", null).readToSingleLong()
|
||||
return db.query("SELECT total_changes()", arrayOf()).readToSingleLong()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@@ -120,7 +120,7 @@ object SqlUtil {
|
||||
|
||||
@JvmStatic
|
||||
fun isEmpty(db: SupportSQLiteDatabase, table: String): Boolean {
|
||||
db.query("SELECT COUNT(*) FROM $table", null).use { cursor ->
|
||||
db.query("SELECT COUNT(*) FROM $table", arrayOf()).use { cursor ->
|
||||
return if (cursor.moveToFirst()) {
|
||||
cursor.getInt(0) == 0
|
||||
} else {
|
||||
@@ -131,7 +131,7 @@ object SqlUtil {
|
||||
|
||||
@JvmStatic
|
||||
fun columnExists(db: SupportSQLiteDatabase, table: String, column: String): Boolean {
|
||||
db.query("PRAGMA table_info($table)", null).use { cursor ->
|
||||
db.query("PRAGMA table_info($table)", arrayOf()).use { cursor ->
|
||||
val nameColumnIndex = cursor.getColumnIndexOrThrow("name")
|
||||
while (cursor.moveToNext()) {
|
||||
val name = cursor.getString(nameColumnIndex)
|
||||
|
||||
@@ -31,11 +31,11 @@ private class CapturingSqliteProgram(count: Int) : SupportSQLiteProgram {
|
||||
args[index - 1] = value.toString()
|
||||
}
|
||||
|
||||
override fun bindString(index: Int, value: String?) {
|
||||
override fun bindString(index: Int, value: String) {
|
||||
args[index - 1] = value
|
||||
}
|
||||
|
||||
override fun bindBlob(index: Int, value: ByteArray?) {
|
||||
override fun bindBlob(index: Int, value: ByteArray) {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user