mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-30 13:35:27 +00:00
Fix SQL command syntax
This commit is contained in:
parent
31f88e0f05
commit
d7ee4ef5f5
@ -14,7 +14,7 @@ class SettingsDao : MagiskDB() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun fetch(key: String, default: Int = -1): Int {
|
suspend fun fetch(key: String, default: Int = -1): Int {
|
||||||
val query = "SELECT value FROM ${Table.SETTINGS} WHERE key == \"$key\" LIMIT = 1"
|
val query = "SELECT value FROM ${Table.SETTINGS} WHERE key == \"$key\" LIMIT 1"
|
||||||
return exec(query) { it["value"]?.toInt() }.firstOrNull() ?: default
|
return exec(query) { it["value"]?.toInt() }.firstOrNull() ?: default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ class StringDao : MagiskDB() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun fetch(key: String, default: String = ""): String {
|
suspend fun fetch(key: String, default: String = ""): String {
|
||||||
val query = "SELECT value FROM ${Table.STRINGS} WHERE key == \"$key\" LIMIT = 1"
|
val query = "SELECT value FROM ${Table.STRINGS} WHERE key == \"$key\" LIMIT 1"
|
||||||
return exec(query) { it["value"] }.firstOrNull() ?: default
|
return exec(query) { it["value"] }.firstOrNull() ?: default
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user