pub enum QueryTextMode {
Full,
Obfuscated,
Off,
}Expand description
Controls whether and how db.query.text is captured on spans.
§Automatic parameter capture
SQLx uses parameterised queries ($1, ?) by default, so Full mode is safe for
most use cases. If you build SQL via format! with interpolated values, use
Obfuscated or Off to avoid capturing sensitive data.
Note that db.query.parameter.<key> capture is not supported automatically – SQLx’s
Execute trait does not expose bind parameter values. Users who need per-parameter
attributes can add them manually via the OpenTelemetry span context API.
Variants§
Full
Capture the parameterised query text as-is. This is the default because SQLx
queries use bind parameters ($1, ?), so literal values are not present in the
query string.
Obfuscated
Replace literal values in the query text with placeholders. Useful when queries are built via string interpolation rather than bind parameters.
Off
Do not capture db.query.text at all.
Trait Implementations§
Source§impl Clone for QueryTextMode
impl Clone for QueryTextMode
Source§fn clone(&self) -> QueryTextMode
fn clone(&self) -> QueryTextMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QueryTextMode
impl Debug for QueryTextMode
Source§impl Default for QueryTextMode
impl Default for QueryTextMode
Source§fn default() -> QueryTextMode
fn default() -> QueryTextMode
Source§impl PartialEq for QueryTextMode
impl PartialEq for QueryTextMode
impl Copy for QueryTextMode
impl Eq for QueryTextMode
impl StructuralPartialEq for QueryTextMode
Auto Trait Implementations§
impl Freeze for QueryTextMode
impl RefUnwindSafe for QueryTextMode
impl Send for QueryTextMode
impl Sync for QueryTextMode
impl Unpin for QueryTextMode
impl UnsafeUnpin for QueryTextMode
impl UnwindSafe for QueryTextMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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>
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