ArrowCrudRepository

Interface defining a contract for basic CRUD (Create, Read, Update, Delete) operations on a data source.

This interface abstracts common operations to be implemented for handling entities of type T. Each operation is asynchronous and returns a DbResult, encapsulating either the successful result or an error in case of failure.

Parameters

T

The type of the entity managed by the repository.

Functions

Link copied to clipboard
open suspend fun <R> aroundQuery(method: String, statement: Statement, block: suspend () -> R): R
Link copied to clipboard
abstract suspend fun delete(context: QueryExecutor, entity: T): DbResult<Unit>

Deletes the given entity from the data source using the specified driver context.

Link copied to clipboard
abstract suspend fun insert(context: QueryExecutor, entity: T): DbResult<T>

Inserts the given entity into the data source using the specified driver context.

Link copied to clipboard
open suspend fun preDeleteHook(entity: T): T
Link copied to clipboard
open suspend fun preInsertHook(entity: T): T
Link copied to clipboard
open suspend fun preUpdateHook(entity: T): T
Link copied to clipboard
abstract suspend fun save(context: QueryExecutor, entity: T): DbResult<T>

Saves the given entity to the data source using the specified driver context.

Link copied to clipboard
abstract suspend fun update(context: QueryExecutor, entity: T): DbResult<T>

Updates the given entity in the data source using the specified driver context.