RpcRequestBuilder

class RpcRequestBuilder(defaultSchema: String, propertyConversionMethod: PropertyConversionMethod) : PostgrestRequestBuilder(source)

Request builder for Postgrest.rpcRequest

Constructors

Link copied to clipboard
constructor(defaultSchema: String, propertyConversionMethod: PropertyConversionMethod)

Properties

Link copied to clipboard
var count: Count?

The Count algorithm to use to count rows in the table or view.

Link copied to clipboard
val headers: HeadersBuilder
Link copied to clipboard

The HTTP method to use. Default is POST

Link copied to clipboard
Link copied to clipboard

The Returning option to use.

Link copied to clipboard

The database schema

Functions

Link copied to clipboard
fun count(count: Count)

Setting count allows to use PostgrestResult.countOrNull to get the total amount of items in the database.

Link copied to clipboard
fun csv()

Return data as a string in CSV format.

Link copied to clipboard
fun explain(analyze: Boolean = false, verbose: Boolean = false, settings: Boolean = false, buffers: Boolean = false, wal: Boolean = false, format: String = "text")

Return data as the EXPLAIN plan for the query.

Link copied to clipboard
inline fun filter(block: PostgrestFilterBuilder.() -> Unit)

Adds a filter to the postgrest request.

Link copied to clipboard
fun geojson()

Return data as an object in GeoJSON format.

Link copied to clipboard
fun limit(count: Long, referencedTable: String? = null)

Limits the result to count rows

Link copied to clipboard
fun order(column: String, order: Order, nullsFirst: Boolean = false, referencedTable: String? = null)

Orders the result by column in the specified order.

Link copied to clipboard
fun range(range: LongRange, referencedTable: String? = null)

Limits the result to rows from range.first to range.last

fun range(from: Long, to: Long, referencedTable: String? = null)

Limits the result to rows from from to to

Link copied to clipboard
fun select(columns: Columns = Columns.ALL)

Return data after the query has been executed.

Link copied to clipboard
fun single()

Return data as a single object instead of an array of objects.