pub struct QueryContext {
pub query: String,
pub normalized: String,
pub tables: Vec<String>,
pub is_read_only: bool,
pub hook_context: HookContext,
}Expand description
Query context for query-related hooks
Fields§
§query: StringThe SQL query
normalized: StringNormalized query (for fingerprinting)
tables: Vec<String>Tables referenced
is_read_only: boolIs read-only query
hook_context: HookContextHook context
Trait Implementations§
Source§impl Clone for QueryContext
impl Clone for QueryContext
Source§fn clone(&self) -> QueryContext
fn clone(&self) -> QueryContext
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 QueryContext
impl Debug for QueryContext
Source§impl RequestView for QueryContext
Available on crate feature wasm-plugins only.
impl RequestView for QueryContext
Available on crate feature
wasm-plugins only.Source§fn query(&self) -> Option<&str>
fn query(&self) -> Option<&str>
SQL text of the query being processed, if this request carries a
query. Returns
None for non-SQL protocol messages
(e.g. Terminate, Sync) or for contexts that don’t carry SQL.Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Whether the query is a read-only operation (SELECT / SHOW / …).
Defaults to
false for safety — an implementation that cannot
classify a query should leave the default.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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