Postgrest
Plugin to interact with the supabase Postgrest API
To use it you need to install it to the SupabaseClient:
val supabase = createSupabaseClient(supabaseUrl, supabaseKey) {
install(Postgrest)
}
Content copied to clipboard
then you can use it like this:
val product = supabase.postgrest["products"].select {
Product::id eq 2
}.decodeSingle<Product>()
Content copied to clipboard
Types
Link copied to clipboard
Link copied to clipboard
data class Config(var defaultSchema: String = "public", var propertyConversionMethod: PropertyConversionMethod = PropertyConversionMethod.CAMEL_CASE_TO_SNAKE_CASE) : MainConfig, CustomSerializationConfig
Config for the Postgrest plugin
Properties
Functions
Link copied to clipboard
Creates a new PostgrestQueryBuilder for the given table
Creates a new PostgrestQueryBuilder for the given schema and table
Link copied to clipboard
Creates a new PostgrestQueryBuilder for the given schema and table
Creates a new PostgrestQueryBuilder for the given table
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract suspend fun rpc(function: String, request: RpcRequestBuilder.() -> Unit = {}): PostgrestResult
abstract suspend fun rpc(function: String, parameters: JsonObject, request: RpcRequestBuilder.() -> Unit = {}): PostgrestResult
Executes a database function
Link copied to clipboard
inline suspend fun <T : Any> Postgrest.rpc(function: String, parameters: T, noinline request: RpcRequestBuilder.() -> Unit = {}): PostgrestResult
Executes a database function