pub struct Response {
pub command_tag: String,
pub columns: Vec<Column>,
pub rows: Vec<Vec<Value>>,
pub truncated: bool,
}Expand description
Unary response from db query.
Fields§
§command_tag: StringWire-protocol-style command tag — e.g. "SELECT 5",
"SHOW 1", "EXPLAIN 12", "SET 0". Synthesized from
{leading_keyword} {row_count} since sqlx 0.8 doesn’t
expose the wire-protocol CommandComplete tag; close
enough for telemetry / display.
columns: Vec<Column>Result columns in select-list order. Empty for no-row statements (SET / LISTEN / DO).
rows: Vec<Vec<Value>>One inner Vec per row, length matches columns.len().
Each cell is a serde_json::Value produced by the CLI’s
per-cell pg_value_to_json decoder. Common type
encodings: text/uuid/timestamps as JSON String, numeric
as String (preserving precision), bytea as base64 String,
json/jsonb passthrough as Value, arrays recurse. Empty
when the statement returns no rows (no-row command OR a
SELECT with no matches).
truncated: boolAlways false in the current design. Reserved on the wire
so a future “soft truncation” mode can be added without a
shape break.
Trait Implementations§
Source§impl CommandResponse for Response
Available on crate feature mcp only.
impl CommandResponse for Response
mcp only.fn into_mcp(self) -> McpResponseItem
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Response
impl JsonSchema for Response
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more