pub struct QueryMetadata {
pub model: Option<String>,
pub operation: Option<String>,
pub request_id: Option<String>,
pub user_id: Option<String>,
pub tenant_id: Option<String>,
pub schema_override: Option<String>,
pub tags: HashMap<String, String>,
pub attributes: HashMap<String, Value>,
}Expand description
Metadata about a query.
Fields§
§model: Option<String>The model being queried (if known).
operation: Option<String>The operation name (e.g., “findMany”, “create”).
request_id: Option<String>Request ID for tracing.
user_id: Option<String>User ID for auditing.
tenant_id: Option<String>Tenant ID for multi-tenancy.
schema_override: Option<String>Schema override for multi-tenancy.
Custom tags for filtering.
attributes: HashMap<String, Value>Custom attributes.
Implementations§
Source§impl QueryMetadata
impl QueryMetadata
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model name.
Sourcepub fn with_operation(self, operation: impl Into<String>) -> Self
pub fn with_operation(self, operation: impl Into<String>) -> Self
Set the operation name.
Sourcepub fn with_request_id(self, id: impl Into<String>) -> Self
pub fn with_request_id(self, id: impl Into<String>) -> Self
Set the request ID.
Sourcepub fn with_user_id(self, id: impl Into<String>) -> Self
pub fn with_user_id(self, id: impl Into<String>) -> Self
Set the user ID.
Sourcepub fn with_tenant_id(self, id: impl Into<String>) -> Self
pub fn with_tenant_id(self, id: impl Into<String>) -> Self
Set the tenant ID.
Sourcepub fn with_attribute(self, key: impl Into<String>, value: Value) -> Self
pub fn with_attribute(self, key: impl Into<String>, value: Value) -> Self
Add an attribute.
Sourcepub fn set_schema_override(&mut self, schema: Option<String>)
pub fn set_schema_override(&mut self, schema: Option<String>)
Set the schema override for multi-tenancy.
Sourcepub fn schema_override(&self) -> Option<&str>
pub fn schema_override(&self) -> Option<&str>
Get the schema override.
Trait Implementations§
Source§impl Clone for QueryMetadata
impl Clone for QueryMetadata
Source§fn clone(&self) -> QueryMetadata
fn clone(&self) -> QueryMetadata
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 QueryMetadata
impl Debug for QueryMetadata
Auto Trait Implementations§
impl Freeze for QueryMetadata
impl RefUnwindSafe for QueryMetadata
impl Send for QueryMetadata
impl Sync for QueryMetadata
impl Unpin for QueryMetadata
impl UnwindSafe for QueryMetadata
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