pub struct QueryContext {
pub sql: CompactString,
pub params: Box<[CompactString]>,
pub param_count: usize,
}Expand description
The SQL and parameters of a failed query.
Attach it with ResultExt::with_query. The error message and the
Debug output show the SQL and how many parameters were bound, never
their values: they often hold personal data or secrets, and errors end up
in logs (.unwrap() prints Debug). The values stay available in
params.
Fields§
§sql: CompactStringRendered SQL statement.
params: Box<[CompactString]>Debug-rendered parameter values, truncated to keep errors bounded.
param_count: usizeTotal number of parameters, including any omitted from params.
Implementations§
Trait Implementations§
Source§impl Clone for QueryContext
impl Clone for QueryContext
Auto Trait Implementations§
impl Freeze for QueryContext
impl RefUnwindSafe for QueryContext
impl Send for QueryContext
impl Sync for QueryContext
impl Unpin for QueryContext
impl UnsafeUnpin for QueryContext
impl UnwindSafe for QueryContext
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