pub struct PgRow {
pub columns: Vec<Option<Vec<u8>>>,
pub column_info: Option<Arc<ColumnInfo>>,
}Expand description
PostgreSQL row with column data and metadata.
Fields§
§columns: Vec<Option<Vec<u8>>>§column_info: Option<Arc<ColumnInfo>>Implementations§
Source§impl PgRow
impl PgRow
Sourcepub fn get_string(&self, idx: usize) -> Option<String>
pub fn get_string(&self, idx: usize) -> Option<String>
Get a column value as String. Returns None if the value is NULL or invalid UTF-8.
Sourcepub fn get_uuid(&self, idx: usize) -> Option<String>
pub fn get_uuid(&self, idx: usize) -> Option<String>
Get a column value as UUID string. Handles both text format (36-char string) and binary format (16 bytes).
Sourcepub fn get_json(&self, idx: usize) -> Option<String>
pub fn get_json(&self, idx: usize) -> Option<String>
Get a column value as JSON string. Handles both JSON (text) and JSONB (version byte prefix) formats.
Sourcepub fn get_timestamp(&self, idx: usize) -> Option<String>
pub fn get_timestamp(&self, idx: usize) -> Option<String>
Get a column value as timestamp string (ISO 8601 format).
Sourcepub fn get_text_array(&self, idx: usize) -> Option<Vec<String>>
pub fn get_text_array(&self, idx: usize) -> Option<Vec<String>>
Get a column value as text array.
Sourcepub fn get_int_array(&self, idx: usize) -> Option<Vec<i64>>
pub fn get_int_array(&self, idx: usize) -> Option<Vec<i64>>
Get a column value as integer array.
Sourcepub fn text(&self, idx: usize) -> String
pub fn text(&self, idx: usize) -> String
Get string, defaulting to empty string if NULL.
Ergonomic shortcut: row.text(0) instead of row.get_string(0).unwrap_or_default()
Sourcepub fn text_or(&self, idx: usize, default: &str) -> String
pub fn text_or(&self, idx: usize, default: &str) -> String
Get string with custom default if NULL.
Example: row.text_or(1, "Unknown")
Sourcepub fn int(&self, idx: usize) -> i64
pub fn int(&self, idx: usize) -> i64
Get i64, defaulting to 0 if NULL.
Ergonomic shortcut: row.int(4) instead of row.get_i64(4).unwrap_or(0)
Sourcepub fn column_index(&self, name: &str) -> Option<usize>
pub fn column_index(&self, name: &str) -> Option<usize>
Get column index by name.
Sourcepub fn get_string_by_name(&self, name: &str) -> Option<String>
pub fn get_string_by_name(&self, name: &str) -> Option<String>
Get a String column by name.
Sourcepub fn get_i32_by_name(&self, name: &str) -> Option<i32>
pub fn get_i32_by_name(&self, name: &str) -> Option<i32>
Get an i32 column by name.
Sourcepub fn get_i64_by_name(&self, name: &str) -> Option<i64>
pub fn get_i64_by_name(&self, name: &str) -> Option<i64>
Get an i64 column by name.
Sourcepub fn get_f64_by_name(&self, name: &str) -> Option<f64>
pub fn get_f64_by_name(&self, name: &str) -> Option<f64>
Get a f64 column by name.
Sourcepub fn get_bool_by_name(&self, name: &str) -> Option<bool>
pub fn get_bool_by_name(&self, name: &str) -> Option<bool>
Get a bool column by name.
Sourcepub fn get_uuid_by_name(&self, name: &str) -> Option<String>
pub fn get_uuid_by_name(&self, name: &str) -> Option<String>
Get a UUID column by name.
Sourcepub fn get_json_by_name(&self, name: &str) -> Option<String>
pub fn get_json_by_name(&self, name: &str) -> Option<String>
Get a JSON column by name.
Sourcepub fn is_null_by_name(&self, name: &str) -> bool
pub fn is_null_by_name(&self, name: &str) -> bool
Check if a column is NULL by name.