ExposedKacheController

class ExposedKacheController(cacheEnabled: () -> Boolean = { true }, cache: CacheClient, asyncWriteScope: CoroutineScope? = null, onAsyncWriteError: (Throwable) -> Unit = {}) : KacheController

Exposed-based adapter providing a typed public API over KacheController.

Works with any database Exposed supports (PostgreSQL, MySQL, H2, SQLite, etc.). Each method delegates to KacheController's internal helpers, deriving cache keys from the Table schema and table names.

Constructors

Link copied to clipboard
constructor(cacheEnabled: () -> Boolean = { true }, cache: CacheClient, asyncWriteScope: CoroutineScope? = null, onAsyncWriteError: (Throwable) -> Unit = {})

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun <T : Model> get(id: String, table: Table, serializer: KSerializer<T>, expire: Duration? = null, getData: suspend Table.() -> T?): T?
Link copied to clipboard
suspend fun <T : Model> getAll(table: Table, serializer: KSerializer<T>, expire: Duration? = null, cacheKey: String = table.cacheKey(), maxCacheSize: Int? = null, getData: suspend Table.() -> List<T>): List<T>
Link copied to clipboard
suspend fun <R : Any> getVolatile(fieldName: String, table: Table, serializer: KSerializer<R>, setData: suspend Table.() -> R): R
Link copied to clipboard
suspend fun remove(id: String, table: Table, deleteData: suspend Table.() -> Boolean): Boolean
Link copied to clipboard
suspend fun removeAll(table: Table, cacheKey: String = table.cacheKey(), deleteData: suspend Table.() -> Boolean): Boolean
Link copied to clipboard
suspend fun <T : Model> set(table: Table, cacheKey: String = table.cacheKey(), serializer: KSerializer<T>, expire: Duration? = null, invalidateVolatiles: Boolean = true, setData: suspend Table.() -> T?): T?
Link copied to clipboard
suspend fun <T : Model> setAll(table: Table, serializer: KSerializer<T>, expire: Duration? = null, invalidateVolatiles: Boolean = true, maxCacheSize: Int? = null, cacheKey: String = table.cacheKey(), setData: suspend Table.() -> List<T>?): Boolean