pub struct Select {
pub from_table: FromTable,
pub filter: Option<Expr>,
pub group_by: Option<Vec<Expr>>,
pub having: Option<Expr>,
pub projection: Option<Vec<ExprRename>>,
pub order_by: Option<Vec<Order>>,
pub range: Option<Range>,
}Fields§
§from_table: FromTable§filter: Option<Expr>§group_by: Option<Vec<Expr>>§having: Option<Expr>§projection: Option<Vec<ExprRename>>§order_by: Option<Vec<Order>>§range: Option<Range>Implementations§
Source§impl Select
impl Select
pub fn into_sql_select( &self, table_lookup: Option<&TableLookup>, ) -> Result<Select, Error>
pub fn into_sql_query( &self, table_lookup: Option<&TableLookup>, ) -> Result<Query, Error>
Sourcepub fn into_sql_statement(
&self,
table_lookup: Option<&TableLookup>,
) -> Result<Statement, Error>
pub fn into_sql_statement( &self, table_lookup: Option<&TableLookup>, ) -> Result<Statement, Error>
Examples found in repository?
examples/simple.rs (line 7)
1fn main() {
2 let url = "/person?age=lt.42&(student=eq.true|gender=eq.'M')&group_by=sum(age),grade,gender&having=min(age)=gt.42&order_by=age.desc,height.asc&page=20&page_size=100";
3 let query = inquerest::parse_query(url);
4 println!("query: {:#?}", query);
5 println!(
6 "sql query: {}",
7 query.unwrap().into_sql_statement(None).unwrap().to_string()
8 );
9
10 let filter = "age=lt.42&(student=eq.true|gender=eq.'M')&group_by=sum(age),grade,gender&having=min(age)=gt.42&order_by=age.desc,height.asc&page=20&page_size=100";
11 let result = inquerest::parse_filter(filter);
12 println!("filter_only: {:#?}", result);
13}Trait Implementations§
impl StructuralPartialEq for Select
Auto Trait Implementations§
impl Freeze for Select
impl RefUnwindSafe for Select
impl Send for Select
impl Sync for Select
impl Unpin for Select
impl UnwindSafe for Select
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