pub struct QueryResult {
pub status: StatusCode,
pub rows: Vec<Value>,
pub total_count: Option<i64>,
pub content_range: Option<ContentRange>,
pub location: Option<String>,
pub allow: Option<String>,
pub guc_headers: Option<String>,
pub guc_status: Option<String>,
pub omit_body: bool,
pub affected: usize,
pub singular: bool,
pub raw_body: Option<(String, Vec<u8>)>,
}Expand description
Query result for response formatting.
Fields§
§status: StatusCodeHTTP status code
rows: Vec<Value>Result rows
total_count: Option<i64>Total row count (for pagination)
content_range: Option<ContentRange>Content range
location: Option<String>Location header (for POST)
allow: Option<String>The methods an OPTIONS request is answering about.
Only an OPTIONS sets this; every other response leaves it None and
sends no Allow, since the question was not asked.
guc_headers: Option<String>Custom headers from GUC
guc_status: Option<String>Custom status from GUC
omit_body: boolWhether to send no body at all.
Set for a mutation the caller asked no representation from: the
response carries headers and a status but no payload, where an empty
row set would otherwise render as [].
affected: usizeHow many rows the statement affected.
Distinct from rows.len(), which is empty when no representation was
asked for. How many rows a write touched is a fact about the write, and
a caller that asked for exactly one object is owed an answer about it
whether or not it wanted the object back.
singular: boolWhether the result should be rendered as a single (un-arrayed) value.
Set for PostgREST-compatibility RPC responses where the underlying function is not set-returning: the bare object/scalar is returned instead of a one-element array.
raw_body: Option<(String, Vec<u8>)>A body the database rendered in full, with the media type it is in.
Set when the request asked for a media type the schema declares its own renderer for. The value is the whole payload, so it replaces the usual JSON rendering rather than being wrapped in it.