PostgrestResult

class PostgrestResult(val data: String, val headers: Headers, postgrest: Postgrest)(source)

Represents the result from a postgrest request

Parameters

data

The data of the response.

headers

The headers of the response

Constructors

Link copied to clipboard
constructor(data: String, headers: Headers, postgrest: Postgrest)

Properties

Link copied to clipboard
Link copied to clipboard
val headers: Headers

Functions

Link copied to clipboard
operator fun component1(): String

Returns the data

Link copied to clipboard
operator fun component2(): Headers

Returns the headers

Link copied to clipboard

Returns the total amount of items in the database, or null if no Count option was set in the PostgrestRequestBuilder

Link copied to clipboard
inline fun <T : Any> decodeAs(): T

Decodes data as T using

Link copied to clipboard
inline fun <T : Any> decodeAsOrNull(): T?

Decodes data as T using. If there's an error it will return null

Link copied to clipboard
inline fun <T : Any> decodeList(): List<T>

Decodes data as a list of T

Link copied to clipboard
inline fun <T : Any> decodeSingle(): T

Decodes data as a list of T and returns the first item found

Link copied to clipboard
inline fun <T : Any> decodeSingleOrNull(): T?

Decodes data as a list of T and returns the first item found or null

Link copied to clipboard

Returns the range of items returned