AuditableDatabaseService
Represents a database service that performs operations involving entities implementing the Auditable interface. This service provides convenient methods for persisting and managing auditable entities while ensuring proper handling of audit-related fields such as createdAt, createdBy, updatedAt, and updatedBy.
Type Parameters
T
The type of the entity managed by this service. Must implement the Auditable interface.
Functions
Link copied to clipboard
Link copied to clipboard
context(ec: ExecContext)
inline suspend fun <R> DatabaseService.withTransaction(crossinline block: context(Transaction) suspend () -> R): R
inline suspend fun <R> DatabaseService.withTransaction(crossinline block: context(Transaction) suspend () -> R): R
Executes a transactional context for a given operation. The operation is wrapped in a database transaction and executed while tracking its duration using OpenTelemetry.