pub trait AnyRowExt {
// Required methods
fn get_bool(&self, column: &str) -> Result<bool, Error>;
fn get_text(&self, column: &str) -> Result<String, Error>;
fn get_text_opt(&self, column: &str) -> Result<Option<String>, Error>;
}Expand description
Row helpers for portably stored types.
Required Methods§
Sourcefn get_bool(&self, column: &str) -> Result<bool, Error>
fn get_bool(&self, column: &str) -> Result<bool, Error>
Reads a boolean stored as a 0/1 integer (the portable representation, see
bind_values). The counterpart to binding a bool.
Sourcefn get_text(&self, column: &str) -> Result<String, Error>
fn get_text(&self, column: &str) -> Result<String, Error>
Reads a text column as a String, portably. MySQL reports TEXT columns
as BLOB through sqlx::Any, so a plain String decode fails there; this
falls back to reading the bytes and decoding UTF-8. Use for every text read
so the same code works on every backend.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".