KandraSuspendRepository
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
the entity type annotated with @ScyllaTable
Constructors
Functions
Returns all rows not yet soft-deleted. Requires @SoftDelete(markerProperty = "...") on T — throws KandraSchemaException otherwise.
Same write as save, but returns the entity actually persisted — including any @GeneratedUuid/@CreatedAt/@UpdatedAt/@Version values generated for the write, which save computes internally and then discards. Use this whenever the caller needs those generated values (e.g. to build an HTTP response) instead of the placeholder ones on the object it constructed — see GH #132 / ISS-096.
Same LWT write as saveIfNotExists, but returns the entity actually persisted — including any @GeneratedUuid/@CreatedAt/@UpdatedAt values generated for the write, which saveIfNotExists computes internally and then discards behind a bare Boolean. Returns null when the row already existed (the same case saveIfNotExists reports as false). See KandraRepository.saveIfNotExistsAndGet's doc (the blocking counterpart) — GH #138.
Optimistic-locked update: UPDATE ... IF <version> = ? when the entity has an @Version column (otherwise a blind full-row overwrite — see the kandra-runtime skill doc).
Same write as update, but returns the entity actually persisted — including the post-update @Version (and @UpdatedAt) values update computes internally and then discards. Use this whenever the caller needs those generated values, e.g. to make a subsequent optimistic-locked update()/updateAndGet() call against the same row without risking a spurious io.kandra.core.exception.KandraOptimisticLockException from reusing the stale pre-update version it already had — see GH #136.