Skip to content

Package-level declarations

//fluxbase-kotlin/io.github.nimbleflux.fluxbase

Name Summary
FluxbaseClient [jvm]
class FluxbaseClient
The top-level Fluxbase client — port of FluxbaseClient from sdk/src/client.ts.
FluxbaseClientOptions [jvm]
data class FluxbaseClientOptions(val autoRefresh: Boolean = true, val persist: Boolean = true, val storage: StorageAdapter = MemoryStorage(), val headers: Map<String, String> = emptyMap(), val timeout: Long, val debug: Boolean = false, val trustSslCertificates: Boolean = false)
Options for constructing a FluxbaseClient. Port of FluxbaseClientOptions from sdk/src/types.ts:35.
FluxbaseError [jvm]
data class FluxbaseError(val status: Int? = null, val code: String? = null, val details: Any? = null, val message: String) : RuntimeException
An error from a Fluxbase API call. Port of FluxbaseError from sdk/src/types.ts:235.
FluxbaseResponse [jvm]
sealed interface FluxbaseResponse<out T>
The result type for all Fluxbase SDK operations — the Kotlin equivalent of the TS SDK’s `{ data: T; error: null }
Name Summary
createFluxbaseClient [jvm]
fun createFluxbaseClient(url: String? = null, key: String? = null, options: FluxbaseClientOptions = FluxbaseClientOptions(), transport: HttpTransport? = null): FluxbaseClient
Top-level factory function — Kotlin-idiomatic equivalent of the TS createClient(url, key, options). Delegates to FluxbaseClient.create.
fluxbaseResponse [jvm]
suspend fun <T> fluxbaseResponse(block: suspend () -> T): FluxbaseResponse<T>
Wraps a suspending block, catching exceptions and converting them to FluxbaseResponse.Error. The TS SDK uses wrapAsync for the same purpose (sdk/src/utils/error-handling.ts).
from [jvm]
inline fun <reified T> FluxbaseClient.from(table: String, schema: String? = null): QueryBuilder<T>
Start a PostgREST query against table. Uses a reified type parameter so the kotlinx.serialization serializer is resolved at compile time.
getOrNull [jvm]
fun <T> FluxbaseResponse<T>.getOrNull(): T?
Returns the data on success, or null on error. Equivalent to result.data in the TS SDK.
getOrThrow [jvm]
fun <T> FluxbaseResponse<T>.getOrThrow(): T
Returns the data on success, or throws the error on failure.