CoroutineObjectRepository

class CoroutineObjectRepository<T : Any> constructor(val synchronous: ObjectRepository<T>, val type: KType, documentFormat: NitriteDocumentFormat, dispatcher: CoroutineDispatcher = Dispatchers.IO) : CoroutineWrapper

Constructors

Link copied to clipboard
constructor(synchronous: ObjectRepository<T>, type: KType, documentFormat: NitriteDocumentFormat, dispatcher: CoroutineDispatcher = Dispatchers.IO)

Types

Link copied to clipboard
data class Change<T>(val changeType: ChangeType, val changedItems: Flow<T>)
Link copied to clipboard
data class Item<T>(val changeTimestamp: Instant, val changeType: ChangeType, val item: T)

Properties

Link copied to clipboard
val synchronous: ObjectRepository<T>
Link copied to clipboard
val type: KType

Functions

Link copied to clipboard
suspend fun createIndex(indexOptions: IndexOptions, path: DocumentPathBuilder)
suspend fun createIndex(indexOptions: IndexOptions, path: KProperty<*>)
Link copied to clipboard
suspend fun <T> dispatch(action: suspend CoroutineScope.() -> T): T
Link copied to clipboard
suspend fun find(filter: ObjectFilter? = null, findOptions: FindOptions? = null): Flow<T>
Link copied to clipboard
suspend fun findById(id: Int): T?
suspend fun findById(id: Long): T?
Link copied to clipboard
suspend fun insert(items: Array<T>): WriteResult
Link copied to clipboard
inline suspend fun <T : Any> CoroutineObjectRepository<T>.insert(item: T): WriteResult
inline suspend fun <T : Any> CoroutineObjectRepository<T>.insert(items: Collection<T>): WriteResult
Link copied to clipboard
suspend fun remove(element: T): WriteResult
suspend fun remove(filter: ObjectFilter, removeOptions: RemoveOptions? = null): WriteResult
Link copied to clipboard
suspend fun removeAll(): WriteResult
Link copied to clipboard
suspend fun update(filter: ObjectFilter, update: T, upsert: Boolean = false): WriteResult