Package dev.inmo.micro_utils.repos

Types

ColumnType
Link copied to clipboard
sealed class ColumnType
CRUDRepo
Link copied to clipboard
common
typealias CRUDRepo<ObjectType, IdType, InputValueType> = StandardCRUDRepo<ObjectType, IdType, InputValueType>
FileReadStandardKeyValueRepo
Link copied to clipboard
class FileReadStandardKeyValueRepo(folder: File) : ReadStandardKeyValueRepo<String, File>
FileStandardKeyValueRepo
Link copied to clipboard
class FileStandardKeyValueRepo(folder: File, filesChangedProcessingScope: CoroutineScope?) : StandardKeyValueRepo<String, File> , WriteStandardKeyValueRepo<String, File> , ReadStandardKeyValueRepo<String, File>
FileWriteStandardKeyValueRepo
Link copied to clipboard
class FileWriteStandardKeyValueRepo(folder: File, filesChangedProcessingScope: CoroutineScope?) : WriteStandardKeyValueRepo<String, File>

Files watching will not correctly works on Android with version of API lower than API 26

KeyValueRepo
Link copied to clipboard
common
typealias KeyValueRepo<Key, Value> = StandardKeyValueRepo<Key, Value>
KeyValuesRepo
Link copied to clipboard
common
typealias KeyValuesRepo<Key, Value> = OneToManyKeyValueRepo<Key, Value>
MapKeyValueRepo
Link copied to clipboard
MapperRepo
Link copied to clipboard
interface MapperRepo<FromKey, FromValue, ToKey, ToValue>
interface MapperRepo<FromKey, FromValue, ToKey, ToValue>
interface MapperRepo<FromKey, FromValue, ToKey, ToValue>
MapReadOneToManyKeyValueRepo
Link copied to clipboard
class MapReadOneToManyKeyValueRepo<Key, Value>(map: Map<Key, List<Value>>) : ReadOneToManyKeyValueRepo<Key, Value>
class MapReadOneToManyKeyValueRepo<Key, Value>(map: Map<Key, List<Value>>) : ReadOneToManyKeyValueRepo<Key, Value>
class MapReadOneToManyKeyValueRepo<Key, Value>(map: Map<Key, List<Value>>) : ReadOneToManyKeyValueRepo<Key, Value>
MapWriteOneToManyKeyValueRepo
Link copied to clipboard
OneToManyKeyValueRepo
Link copied to clipboard
ReadCRUDRepo
Link copied to clipboard
common
typealias ReadCRUDRepo<ObjectType, IdType> = ReadStandardCRUDRepo<ObjectType, IdType>
ReadKeyValueRepo
Link copied to clipboard
common
typealias ReadKeyValueRepo<Key, Value> = ReadStandardKeyValueRepo<Key, Value>
ReadKeyValuesRepo
Link copied to clipboard
common
typealias ReadKeyValuesRepo<Key, Value> = ReadOneToManyKeyValueRepo<Key, Value>
ReadMapCRUDRepo
Link copied to clipboard
ReadMapKeyValueRepo
Link copied to clipboard
class ReadMapKeyValueRepo<Key, Value>(map: Map<Key, Value>) : ReadStandardKeyValueRepo<Key, Value>
class ReadMapKeyValueRepo<Key, Value>(map: Map<Key, Value>) : ReadStandardKeyValueRepo<Key, Value>
class ReadMapKeyValueRepo<Key, Value>(map: Map<Key, Value>) : ReadStandardKeyValueRepo<Key, Value>
ReadOneToManyKeyValueRepo
Link copied to clipboard
interface ReadOneToManyKeyValueRepo<Key, Value> : Repo
interface ReadOneToManyKeyValueRepo<Key, Value> : Repo
interface ReadOneToManyKeyValueRepo<Key, Value> : Repo
ReadStandardCRUDRepo
Link copied to clipboard
interface ReadStandardCRUDRepo<ObjectType, IdType> : Repo
interface ReadStandardCRUDRepo<ObjectType, IdType> : Repo
interface ReadStandardCRUDRepo<ObjectType, IdType> : Repo
ReadStandardKeyValueRepo
Link copied to clipboard
interface ReadStandardKeyValueRepo<Key, Value> : Repo
interface ReadStandardKeyValueRepo<Key, Value> : Repo
interface ReadStandardKeyValueRepo<Key, Value> : Repo
Repo
Link copied to clipboard
interface Repo
interface Repo
interface Repo
StandardKeyValueRepo
Link copied to clipboard
StandardSQLHelper
Link copied to clipboard
class StandardSQLHelper(context: Context, name: String, factory: SQLiteDatabase.CursorFactory?, version: Int, errorHandler: DatabaseErrorHandler?, useSharedPreferencesForVersions: Boolean)
TransactionContext
Link copied to clipboard
class TransactionContext(databaseContext: CoroutineContext) : CoroutineContext.Element
UpdatedValuePair
Link copied to clipboard
common
typealias UpdatedValuePair<IdType, ValueType> = Pair<IdType, ValueType>
WriteCRUDRepo
Link copied to clipboard
common
typealias WriteCRUDRepo<ObjectType, IdType, InputValueType> = WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>
WriteKeyValueRepo
Link copied to clipboard
common
typealias WriteKeyValueRepo<Key, Value> = WriteStandardKeyValueRepo<Key, Value>
WriteKeyValuesRepo
Link copied to clipboard
common
typealias WriteKeyValuesRepo<Key, Value> = WriteOneToManyKeyValueRepo<Key, Value>
WriteMapCRUDRepo
Link copied to clipboard
WriteMapKeyValueRepo
Link copied to clipboard
class WriteMapKeyValueRepo<Key, Value>(map: MutableMap<Key, Value>) : WriteStandardKeyValueRepo<Key, Value>
class WriteMapKeyValueRepo<Key, Value>(map: MutableMap<Key, Value>) : WriteStandardKeyValueRepo<Key, Value>
class WriteMapKeyValueRepo<Key, Value>(map: MutableMap<Key, Value>) : WriteStandardKeyValueRepo<Key, Value>
WriteOneToManyKeyValueRepo
Link copied to clipboard
interface WriteOneToManyKeyValueRepo<Key, Value> : Repo
interface WriteOneToManyKeyValueRepo<Key, Value> : Repo
interface WriteOneToManyKeyValueRepo<Key, Value> : Repo
WriteStandardCRUDRepo
Link copied to clipboard
interface WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> : Repo
interface WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> : Repo
interface WriteStandardCRUDRepo<ObjectType, IdType, InputValueType> : Repo
WriteStandardKeyValueRepo
Link copied to clipboard
interface WriteStandardKeyValueRepo<Key, Value> : Repo
interface WriteStandardKeyValueRepo<Key, Value> : Repo
interface WriteStandardKeyValueRepo<Key, Value> : Repo

Functions

add
Link copied to clipboard
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.add(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.add(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.add(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.add(k: Key, v: List<Value>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.add(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.add(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.add(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.add(k: Key, v: List<Value>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.add(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.add(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.add(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.add(k: Key, v: List<Value>)
asCrudRepo
Link copied to clipboard
fun <ObjectType, IdType, InputValueType> MutableMap<IdType, ObjectType>.asCrudRepo(updateCallback: suspend (InputValueType, IdType, ObjectType) -> ObjectType, createCallback: suspend (InputValueType) -> Pair<IdType, ObjectType>): MapCRUDRepo<ObjectType, IdType, InputValueType>
fun <ObjectType, IdType, InputValueType> MutableMap<IdType, ObjectType>.asCrudRepo(updateCallback: suspend (InputValueType, IdType, ObjectType) -> ObjectType, createCallback: suspend (InputValueType) -> Pair<IdType, ObjectType>): MapCRUDRepo<ObjectType, IdType, InputValueType>
fun <ObjectType, IdType, InputValueType> MutableMap<IdType, ObjectType>.asCrudRepo(updateCallback: suspend (InputValueType, IdType, ObjectType) -> ObjectType, createCallback: suspend (InputValueType) -> Pair<IdType, ObjectType>): MapCRUDRepo<ObjectType, IdType, InputValueType>
asKeyValueRepo
Link copied to clipboard
fun <K, V> MutableMap<K, V>.asKeyValueRepo(): StandardKeyValueRepo<K, V>
fun <K, V> MutableMap<K, V>.asKeyValueRepo(): StandardKeyValueRepo<K, V>
fun <K, V> MutableMap<K, V>.asKeyValueRepo(): StandardKeyValueRepo<K, V>
asOneToManyKeyValueRepo
Link copied to clipboard
fun <K, V> MutableMap<K, List<V>>.asOneToManyKeyValueRepo(): OneToManyKeyValueRepo<K, V>
fun <K, V> MutableMap<K, List<V>>.asOneToManyKeyValueRepo(): OneToManyKeyValueRepo<K, V>
fun <K, V> MutableMap<K, List<V>>.asOneToManyKeyValueRepo(): OneToManyKeyValueRepo<K, V>
blockingReadableTransaction
Link copied to clipboard
fun <T> SQLiteOpenHelper.blockingReadableTransaction(block: SQLiteDatabase.() -> T): T
fun <T> StandardSQLHelper.blockingReadableTransaction(block: SQLiteDatabase.() -> T): T
blockingTransaction
Link copied to clipboard
fun <T> SQLiteDatabase.blockingTransaction(block: SQLiteDatabase.() -> T): T
blockingWritableTransaction
Link copied to clipboard
fun <T> SQLiteOpenHelper.blockingWritableTransaction(block: SQLiteDatabase.() -> T): T
fun <T> StandardSQLHelper.blockingWritableTransaction(block: SQLiteDatabase.() -> T): T
contentValuesOfNotNull
Link copied to clipboard
fun contentValuesOfNotNull(vararg pairs: Pair<String, Any?>?): <ERROR CLASS>
create
Link copied to clipboard
createTable
Link copied to clipboard
fun SQLiteDatabase.createTable(tableName: String, vararg columnsToTypes: Pair<String, ColumnType>, onInit: SQLiteDatabase.() -> Unit? = null): Boolean
createTableQuery
Link copied to clipboard
fun createTableQuery(tableName: String, vararg columnsToTypes: Pair<String, ColumnType>): String
deleteById
Link copied to clipboard
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.deleteById(vararg ids: IdType)
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.deleteById(vararg ids: IdType)
suspend fun <ObjectType, IdType, InputValueType> WriteStandardCRUDRepo<ObjectType, IdType, InputValueType>.deleteById(vararg ids: IdType)
firstOrNull
Link copied to clipboard
fun Cursor.firstOrNull(): Cursor?
getDouble
Link copied to clipboard
fun Cursor.getDouble(columnName: String): Double
getDoubleOrNull
Link copied to clipboard
fun Cursor.getDoubleOrNull(columnName: String): Double?
getFloat
Link copied to clipboard
fun Cursor.getFloat(columnName: String): Float
getFloatOrNull
Link copied to clipboard
fun Cursor.getFloatOrNull(columnName: String): Float?
getInt
Link copied to clipboard
fun Cursor.getInt(columnName: String): Int
getIntOrNull
Link copied to clipboard
fun Cursor.getIntOrNull(columnName: String): Int?
getLong
Link copied to clipboard
fun Cursor.getLong(columnName: String): Long
getLongOrNull
Link copied to clipboard
fun Cursor.getLongOrNull(columnName: String): Long?
getShort
Link copied to clipboard
fun Cursor.getShort(columnName: String): Short
getShortOrNull
Link copied to clipboard
fun Cursor.getShortOrNull(columnName: String): Short?
getString
Link copied to clipboard
fun Cursor.getString(columnName: String): String
getStringOrNull
Link copied to clipboard
fun Cursor.getStringOrNull(columnName: String): String?
inlineTransaction
Link copied to clipboard
inline fun <T> SQLiteDatabase.inlineTransaction(crossinline block: SQLiteDatabase.() -> T): T
limitClause
Link copied to clipboard
fun Pagination.limitClause(): String
fun limitClause(size: Int, since: Int? = null): String
fun limitClause(size: Long, since: Long? = null): String
makePlaceholders
Link copied to clipboard
fun makePlaceholders(count: Int): String
makeStringPlaceholders
Link copied to clipboard
fun makeStringPlaceholders(count: Int): String
map
Link copied to clipboard
inline fun <T> Cursor.map(block: (Cursor) -> T): List<T>
MapCRUDRepo
Link copied to clipboard
fun <ObjectType, IdType, InputValueType> MapCRUDRepo(map: MutableMap<IdType, ObjectType>, updateCallback: suspend (InputValueType, IdType, ObjectType) -> ObjectType, createCallback: suspend (InputValueType) -> Pair<IdType, ObjectType>): MapCRUDRepo<ObjectType, IdType, InputValueType>
fun <ObjectType, IdType, InputValueType> MapCRUDRepo(map: MutableMap<IdType, ObjectType>, updateCallback: suspend (InputValueType, IdType, ObjectType) -> ObjectType, createCallback: suspend (InputValueType) -> Pair<IdType, ObjectType>): MapCRUDRepo<ObjectType, IdType, InputValueType>
fun <ObjectType, IdType, InputValueType> MapCRUDRepo(map: MutableMap<IdType, ObjectType>, updateCallback: suspend (InputValueType, IdType, ObjectType) -> ObjectType, createCallback: suspend (InputValueType) -> Pair<IdType, ObjectType>): MapCRUDRepo<ObjectType, IdType, InputValueType>
mapper
Link copied to clipboard
inline fun <FromKey, FromValue, ToKey, ToValue> mapper(crossinline keyFromToTo: suspend FromKey.() -> ToKey = { this as ToKey }, crossinline valueFromToTo: suspend FromValue.() -> ToValue = { this as ToValue }, crossinline keyToToFrom: suspend ToKey.() -> FromKey = { this as FromKey }, crossinline valueToToFrom: suspend ToValue.() -> FromValue = { this as FromValue }): MapperRepo<FromKey, FromValue, ToKey, ToValue>
inline fun <FromKey, FromValue, ToKey, ToValue> mapper(crossinline keyFromToTo: suspend FromKey.() -> ToKey = { this as ToKey }, crossinline valueFromToTo: suspend FromValue.() -> ToValue = { this as ToValue }, crossinline keyToToFrom: suspend ToKey.() -> FromKey = { this as FromKey }, crossinline valueToToFrom: suspend ToValue.() -> FromValue = { this as FromValue }): MapperRepo<FromKey, FromValue, ToKey, ToValue>
inline fun <FromKey, FromValue, ToKey, ToValue> mapper(crossinline keyFromToTo: suspend FromKey.() -> ToKey = { this as ToKey }, crossinline valueFromToTo: suspend FromValue.() -> ToValue = { this as ToValue }, crossinline keyToToFrom: suspend ToKey.() -> FromKey = { this as FromKey }, crossinline valueToToFrom: suspend ToValue.() -> FromValue = { this as FromValue }): MapperRepo<FromKey, FromValue, ToKey, ToValue>
readableTransaction
Link copied to clipboard
suspend fun <T> SQLiteOpenHelper.readableTransaction(block: suspend SQLiteDatabase.() -> T): T
remove
Link copied to clipboard
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(k: Key, v: List<Value>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(k: Key, v: List<Value>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.remove(k: Key, v: List<Value>)
select
Link copied to clipboard
fun SQLiteDatabase.select(table: String, columns: Array<String>? = null, selection: String? = null, selectionArgs: Array<String>? = null, groupBy: String? = null, having: String? = null, orderBy: String? = null, limit: String? = null): Cursor
selectDistinct
Link copied to clipboard
fun SQLiteDatabase.selectDistinct(table: String, columns: Array<String>? = null, selection: String? = null, selectionArgs: Array<String>? = null, groupBy: String? = null, having: String? = null, orderBy: String? = null, limit: String? = null): Cursor
set
Link copied to clipboard
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.set(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.set(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.set(vararg toSet: Pair<Key, Value>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.set(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.set(k: Key, v: List<Value>)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.set(k: Key, v: Value)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.set(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.set(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.set(vararg toSet: Pair<Key, Value>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.set(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.set(k: Key, v: List<Value>)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.set(k: Key, v: Value)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.set(vararg keysAndValues: Pair<Key, List<Value>>)
inline suspend fun <Key, Value, REPO : WriteOneToManyKeyValueRepo<Key, Value>> REPO.set(keysAndValues: List<Pair<Key, List<Value>>>)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.set(vararg toSet: Pair<Key, Value>)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.set(k: Key, vararg v: Value)
inline suspend fun <Key, Value> WriteOneToManyKeyValueRepo<Key, Value>.set(k: Key, v: List<Value>)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.set(k: Key, v: Value)
transaction
Link copied to clipboard
suspend fun <T> SQLiteDatabase.transaction(block: suspend SQLiteDatabase.() -> T): T
unset
Link copied to clipboard
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.unset(vararg k: Key)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.unset(vararg k: Key)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.unset(vararg k: Key)
unsetWithValues
Link copied to clipboard
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.unsetWithValues(vararg v: Value)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.unsetWithValues(vararg v: Value)
inline suspend fun <Key, Value> WriteStandardKeyValueRepo<Key, Value>.unsetWithValues(vararg v: Value)
update
Link copied to clipboard
writableTransaction
Link copied to clipboard
suspend fun <T> SQLiteOpenHelper.writableTransaction(block: suspend SQLiteDatabase.() -> T): T

Properties

DatabaseCoroutineContext
Link copied to clipboard
val DatabaseCoroutineContext: CoroutineContext
id
Link copied to clipboard
val <IdType> UpdatedValuePair<IdType, *>.id: IdType
id
Link copied to clipboard
common
val <IdType> UpdatedValuePair<IdType, *>.id: IdType
id
Link copied to clipboard
val <IdType> UpdatedValuePair<IdType, *>.id: IdType
internalId
Link copied to clipboard
val internalId: String
internalIdType
Link copied to clipboard
val internalIdType: ColumnType.Numeric.INTEGER
value
Link copied to clipboard
val <ValueType> UpdatedValuePair<*, ValueType>.value: ValueType
value
Link copied to clipboard
common
val <ValueType> UpdatedValuePair<*, ValueType>.value: ValueType
value
Link copied to clipboard
val <ValueType> UpdatedValuePair<*, ValueType>.value: ValueType