pub enum Transformation {
Show 14 variants
NoOp,
Replace(String),
AddIndexHint {
table: String,
index: String,
},
ExpandSelectStar {
columns: Vec<String>,
},
AddLimit(u32),
AddWhereClause(String),
AppendWhereAnd(String),
ReplaceTable {
from: String,
to: String,
},
AddOrderBy {
column: String,
descending: bool,
},
AddHint(String),
AddBranchHint(String),
AddTimeout(Duration),
Custom(String),
Chain(Vec<Transformation>),
}Expand description
Query transformation
Variants§
NoOp
No operation (pass through)
Replace(String)
Replace entire query
AddIndexHint
Add index hint
ExpandSelectStar
Rewrite SELECT * to specific columns
AddLimit(u32)
Add LIMIT clause
AddWhereClause(String)
Add WHERE condition
AppendWhereAnd(String)
Append to WHERE clause with AND
ReplaceTable
Replace table name
AddOrderBy
Add ORDER BY clause
AddHint(String)
Add query hint comment
AddBranchHint(String)
Add branch routing hint
AddTimeout(Duration)
Add timeout hint
Custom(String)
Custom transformation by name
Chain(Vec<Transformation>)
Chain multiple transformations
Implementations§
Source§impl Transformation
impl Transformation
Sourcepub fn replace_table(from: impl Into<String>, to: impl Into<String>) -> Self
pub fn replace_table(from: impl Into<String>, to: impl Into<String>) -> Self
Create a replace-table transformation
Sourcepub fn expand_select_star(columns: Vec<impl Into<String>>) -> Self
pub fn expand_select_star(columns: Vec<impl Into<String>>) -> Self
Create an expand-select-star transformation
Sourcepub fn add_index_hint(
table: impl Into<String>,
index: impl Into<String>,
) -> Self
pub fn add_index_hint( table: impl Into<String>, index: impl Into<String>, ) -> Self
Create an add-index-hint transformation
Sourcepub fn chain(transformations: Vec<Transformation>) -> Self
pub fn chain(transformations: Vec<Transformation>) -> Self
Create a chain transformation
Trait Implementations§
Source§impl Clone for Transformation
impl Clone for Transformation
Source§fn clone(&self) -> Transformation
fn clone(&self) -> Transformation
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 moreAuto Trait Implementations§
impl Freeze for Transformation
impl RefUnwindSafe for Transformation
impl Send for Transformation
impl Sync for Transformation
impl Unpin for Transformation
impl UnsafeUnpin for Transformation
impl UnwindSafe for Transformation
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