pub struct SqlQueryLogBuilder { /* private fields */ }Expand description
Builder for creating SQL query logs.
Implementations§
Source§impl SqlQueryLogBuilder
impl SqlQueryLogBuilder
Sourcepub fn new(query_id: &str, sql: &str, param_count: usize) -> Self
pub fn new(query_id: &str, sql: &str, param_count: usize) -> Self
Create new SQL query log builder.
§Arguments
query_id- Unique identifier for the GraphQL querysql- The SQL statement (will be truncated if > 2000 chars)param_count- Number of bound parameters
Sourcepub const fn with_slow_threshold(self, threshold_us: u64) -> Self
pub const fn with_slow_threshold(self, threshold_us: u64) -> Self
Set slow query threshold in microseconds.
Sourcepub fn finish_success(self, rows_affected: Option<usize>) -> SqlQueryLog
pub fn finish_success(self, rows_affected: Option<usize>) -> SqlQueryLog
Finish logging and create log entry (successful execution).
Sourcepub fn finish_error(self, error: &str) -> SqlQueryLog
pub fn finish_error(self, error: &str) -> SqlQueryLog
Finish logging and create log entry (failed execution).
Auto Trait Implementations§
impl Freeze for SqlQueryLogBuilder
impl RefUnwindSafe for SqlQueryLogBuilder
impl Send for SqlQueryLogBuilder
impl Sync for SqlQueryLogBuilder
impl Unpin for SqlQueryLogBuilder
impl UnsafeUnpin for SqlQueryLogBuilder
impl UnwindSafe for SqlQueryLogBuilder
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
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>
Converts
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>
Converts
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