pub struct Query {
pub eager_relations: Vec<String>,
pub joins: Vec<Join>,
pub filter: Option<Filter>,
pub order_by: Vec<(String, OrderDirection)>,
pub limit: Option<usize>,
pub offset: Option<usize>,
/* private fields */
}Expand description
A struct representing a query in the DBMS.
Fields§
§eager_relations: Vec<String>Relations to eagerly load with the main records.
joins: Vec<Join>Join operations
filter: Option<Filter>Filter to apply to the query.
order_by: Vec<(String, OrderDirection)>Order by clauses for sorting the results.
limit: Option<usize>Limit on the number of records to return.
offset: Option<usize>Offset for pagination.
Implementations§
Source§impl Query
impl Query
Sourcepub fn builder() -> QueryBuilder
pub fn builder() -> QueryBuilder
Creates a new QueryBuilder for building a query.
Sourcepub fn all_selected(&self) -> bool
pub fn all_selected(&self) -> bool
Returns whether all columns are selected in the query.
Sourcepub fn columns<T>(&self) -> Vec<String>where
T: TableSchema,
pub fn columns<T>(&self) -> Vec<String>where
T: TableSchema,
Returns the list of columns to be selected in the query.
Sourcepub fn raw_columns(&self) -> &[String]
pub fn raw_columns(&self) -> &[String]
Returns the raw column names from the Select clause.
Unlike columns::<T>(), this does not expand Select::All
using the table schema.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Query
impl<'de> Deserialize<'de> for Query
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Query
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
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