KandraSuspendRepository
class KandraSuspendRepository<T : Any>(session: CqlSession, schema: TableSchema, entityClass: KClass<T>, batchEngine: BatchEngine)
Coroutine-friendly repository for performing CRUD operations on a ScyllaDB table.
All write operations delegate to BatchEngine (which wraps blocking driver calls); wrap in withContext(Dispatchers.IO) when needed in production.
Parameters
T
the entity type annotated with @ScyllaTable
Constructors
Link copied to clipboard
constructor(session: CqlSession, schema: TableSchema, entityClass: KClass<T>, batchEngine: BatchEngine)
Functions
Link copied to clipboard
suspend fun <V> append(entity: T, field: KProperty1<T, Collection<V>?>, values: Collection<V>, consistency: KandraConsistency? = null)
Link copied to clipboard
suspend fun decrement(field: KProperty1<T, Long?>, partitionKeys: Map<String, Any>, by: Long = 1, consistency: KandraConsistency? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns all rows not yet soft-deleted. Requires @SoftDelete(markerProperty = "...") on T — throws KandraSchemaException otherwise.
Link copied to clipboard
Link copied to clipboard
suspend fun findPage(pageSize: Int, pageToken: String? = null, block: QueryContext.() -> Unit = {}): KandraPage<T>
Link copied to clipboard
suspend fun increment(field: KProperty1<T, Long?>, partitionKeys: Map<String, Any>, by: Long = 1, consistency: KandraConsistency? = null)
Link copied to clipboard
Link copied to clipboard
suspend fun <V> remove(entity: T, field: KProperty1<T, Collection<V>?>, values: Collection<V>, consistency: KandraConsistency? = null)
Link copied to clipboard
suspend fun saveIfNotExists(entity: T, serialConsistency: KandraConsistency = KandraConsistency.LOCAL_SERIAL): Boolean
Link copied to clipboard
Link copied to clipboard