pub struct SqlQueryLog {
pub query_id: String,
pub sql: String,
pub param_count: usize,
pub duration_us: u64,
pub rows_affected: Option<usize>,
pub success: bool,
pub error: Option<String>,
pub operation: SqlOperation,
pub slow_threshold_us: Option<u64>,
pub was_slow: bool,
}Expand description
SQL query log entry with execution details.
Fields§
§query_id: StringQuery ID for correlation
sql: StringSQL statement (truncated for very large queries)
param_count: usizeBound parameters count
duration_us: u64Execution time in microseconds
rows_affected: Option<usize>Number of rows affected/returned
success: boolWhether query executed successfully
error: Option<String>Error message if query failed
operation: SqlOperationDatabase operation type (SELECT, INSERT, UPDATE, DELETE, etc.)
slow_threshold_us: Option<u64>Optional slow query warning threshold (microseconds)
was_slow: boolWhether this query exceeded slow threshold
Implementations§
Source§impl SqlQueryLog
impl SqlQueryLog
Sourcepub fn to_log_string(&self) -> String
pub fn to_log_string(&self) -> String
Get log entry as a formatted string suitable for logging.
Sourcepub fn duration_ms(&self) -> f64
pub fn duration_ms(&self) -> f64
Get execution time in milliseconds (for human-friendly display).
Trait Implementations§
Source§impl Clone for SqlQueryLog
impl Clone for SqlQueryLog
Source§fn clone(&self) -> SqlQueryLog
fn clone(&self) -> SqlQueryLog
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SqlQueryLog
impl Debug for SqlQueryLog
Source§impl<'de> Deserialize<'de> for SqlQueryLog
impl<'de> Deserialize<'de> for SqlQueryLog
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SqlQueryLog
impl RefUnwindSafe for SqlQueryLog
impl Send for SqlQueryLog
impl Sync for SqlQueryLog
impl Unpin for SqlQueryLog
impl UnsafeUnpin for SqlQueryLog
impl UnwindSafe for SqlQueryLog
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
Mutably borrows from an owned value. Read more