pub struct TypedQuery {
pub source: Option<Source>,
pub select_columns: Vec<String>,
pub where_conditions: Option<WhereCondition>,
pub order_by: Vec<String>,
pub limit: Option<usize>,
pub offset: Option<usize>,
}Expand description
A type-safe query builder (generic over column types)
Fields§
§source: Option<Source>The source table or view
select_columns: Vec<String>Selected columns (as strings for flexibility)
where_conditions: Option<WhereCondition>WHERE conditions (type-safe)
order_by: Vec<String>ORDER BY clauses (as strings for flexibility)
limit: Option<usize>LIMIT clause
offset: Option<usize>OFFSET clause
Implementations§
Source§impl TypedQuery
Enhanced typed query with clean projection syntax
impl TypedQuery
Enhanced typed query with clean projection syntax
Sourcepub fn select_clean<S, P>(self, projection: P) -> CleanProjectedQuery<S>
pub fn select_clean<S, P>(self, projection: P) -> CleanProjectedQuery<S>
Ultra-clean struct projection (no .into() needed!)
Sourcepub fn select_auto<S>(self) -> CleanProjectedQuery<S>where
S: AutoProjection + Default,
pub fn select_auto<S>(self) -> CleanProjectedQuery<S>where
S: AutoProjection + Default,
Automatic projection based on struct field names
Source§impl TypedQuery
Shorthand query builders
impl TypedQuery
Shorthand query builders
Sourcepub fn select<S>(self) -> CleanProjectedQuery<S>where
S: AutoProjection + Default,
pub fn select<S>(self) -> CleanProjectedQuery<S>where
S: AutoProjection + Default,
Super clean syntax for common patterns
Sourcepub fn where_select<S, W>(self, where_clause: W) -> CleanProjectedQuery<S>
pub fn where_select<S, W>(self, where_clause: W) -> CleanProjectedQuery<S>
Clean where + select in one call
Source§impl TypedQuery
Enhanced typed query with LINQ-style projections
impl TypedQuery
Enhanced typed query with LINQ-style projections
Sourcepub fn select_field<F, P>(self, projection: P) -> ProjectedQuery<F>
pub fn select_field<F, P>(self, projection: P) -> ProjectedQuery<F>
Select a single field (equivalent to C# Select(p => p.Name))
Sourcepub fn select_into<S, P>(self, _projection: P) -> ProjectedQuery<S>
pub fn select_into<S, P>(self, _projection: P) -> ProjectedQuery<S>
Select into a custom struct (equivalent to C# Select(p => new PersonSummary { … }))
Source§impl TypedQuery
impl TypedQuery
Sourcepub fn from_table(self, table: Table) -> Self
pub fn from_table(self, table: Table) -> Self
Set the source table
Sourcepub fn select_columns_from<I>(self, columns: I) -> Self
pub fn select_columns_from<I>(self, columns: I) -> Self
Select specific columns by converting them to strings
Sourcepub fn select_column<T>(self, column: TypedColumn<T>) -> Self
pub fn select_column<T>(self, column: TypedColumn<T>) -> Self
Add a single column to select (accepts any TypedColumn
Sourcepub fn where_clause(self, condition: WhereCondition) -> Self
pub fn where_clause(self, condition: WhereCondition) -> Self
Set WHERE conditions (type-safe)
Trait Implementations§
Source§impl Clone for TypedQuery
impl Clone for TypedQuery
Source§fn clone(&self) -> TypedQuery
fn clone(&self) -> TypedQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TypedQuery
impl RefUnwindSafe for TypedQuery
impl Send for TypedQuery
impl Sync for TypedQuery
impl Unpin for TypedQuery
impl UnsafeUnpin for TypedQuery
impl UnwindSafe for TypedQuery
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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