upfix update

This commit is contained in:
InsanusMokrassar 2021-06-13 11:50:48 +06:00
parent 2516d5e381
commit 7cccf7e56e

View File

@ -20,6 +20,8 @@ private val internalSerialFormat = Json {
ignoreUnknownKeys = true ignoreUnknownKeys = true
} }
typealias KeyValuesAndroidRepo<Key, Value> = OneToManyAndroidRepo<Key, Value>
class OneToManyAndroidRepo<Key, Value>( class OneToManyAndroidRepo<Key, Value>(
private val tableName: String, private val tableName: String,
private val keyAsString: Key.() -> String, private val keyAsString: Key.() -> String,
@ -244,3 +246,10 @@ fun <Key, Value> OneToManyAndroidRepo(
{ internalSerialFormat.decodeFromString(valueSerializer, this) }, { internalSerialFormat.decodeFromString(valueSerializer, this) },
helper helper
) )
fun <Key, Value> KeyValuesAndroidRepo(
tableName: String,
keySerializer: KSerializer<Key>,
valueSerializer: KSerializer<Value>,
helper: SQLiteOpenHelper
) = OneToManyAndroidRepo(tableName, keySerializer, valueSerializer, helper)