pub struct QueryBuilder<State = NeedsFrom> { /* private fields */ }Expand description
Type-safe SOQL query builder
§Example
use salesforce_client::QueryBuilder;
let query = QueryBuilder::select(&["Id", "Name"])
.from("Account")
.where_clause("AnnualRevenue > 1000000")
.order_by("Name")
.limit(10)
.build();
assert_eq!(query, "SELECT Id, Name FROM Account WHERE AnnualRevenue > 1000000 ORDER BY Name LIMIT 10");Implementations§
Source§impl QueryBuilder<NeedsFrom>
impl QueryBuilder<NeedsFrom>
Source§impl QueryBuilder<Complete>
impl QueryBuilder<Complete>
Sourcepub fn where_clause(self, condition: impl Into<String>) -> Self
pub fn where_clause(self, condition: impl Into<String>) -> Self
Add a WHERE clause
Sourcepub fn order_by_asc(self, field: impl Into<String>) -> Self
pub fn order_by_asc(self, field: impl Into<String>) -> Self
Add ORDER BY with direction
Sourcepub fn order_by_desc(self, field: impl Into<String>) -> Self
pub fn order_by_desc(self, field: impl Into<String>) -> Self
Add ORDER BY descending
Trait Implementations§
Source§impl<State: Clone> Clone for QueryBuilder<State>
impl<State: Clone> Clone for QueryBuilder<State>
Source§fn clone(&self) -> QueryBuilder<State>
fn clone(&self) -> QueryBuilder<State>
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<State> Freeze for QueryBuilder<State>
impl<State> RefUnwindSafe for QueryBuilder<State>where
State: RefUnwindSafe,
impl<State> Send for QueryBuilder<State>where
State: Send,
impl<State> Sync for QueryBuilder<State>where
State: Sync,
impl<State> Unpin for QueryBuilder<State>where
State: Unpin,
impl<State> UnwindSafe for QueryBuilder<State>where
State: UnwindSafe,
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