pub struct SelectBuilder<T> { /* private fields */ }Expand description
Builder for SELECT queries. Implements both Filterable and Modifiable.
Implementations§
Source§impl<T> SelectBuilder<T>
impl<T> SelectBuilder<T>
Sourcepub fn schema(self, schema: &str) -> SelectBuilder<T>
pub fn schema(self, schema: &str) -> SelectBuilder<T>
Override the schema for this query.
Sourcepub fn explain(self) -> SelectBuilder<T>
pub fn explain(self) -> SelectBuilder<T>
Wrap the SELECT in EXPLAIN (ANALYZE, FORMAT JSON).
Sourcepub fn explain_with(self, options: ExplainOptions) -> SelectBuilder<T>
pub fn explain_with(self, options: ExplainOptions) -> SelectBuilder<T>
Wrap the SELECT in EXPLAIN with custom options.
Sourcepub fn head(self) -> SelectBuilder<T>
pub fn head(self) -> SelectBuilder<T>
Switch to head/count-only mode.
Sourcepub fn csv(self) -> CsvSelectBuilder
pub fn csv(self) -> CsvSelectBuilder
Switch to CSV output mode. Returns a CsvSelectBuilder that
executes the query and returns the raw CSV text.
Sourcepub fn geojson(self) -> GeoJsonSelectBuilder
pub fn geojson(self) -> GeoJsonSelectBuilder
Switch to GeoJSON output mode. Returns a GeoJsonSelectBuilder that
executes the query and returns a serde_json::Value (GeoJSON FeatureCollection).
Source§impl<T> SelectBuilder<T>where
T: DeserializeOwned + Send,
impl<T> SelectBuilder<T>where
T: DeserializeOwned + Send,
Sourcepub async fn execute(self) -> SupabaseResponse<T>
pub async fn execute(self) -> SupabaseResponse<T>
Execute the SELECT query and return results.
Trait Implementations§
Source§impl<T> Filterable for SelectBuilder<T>
impl<T> Filterable for SelectBuilder<T>
Source§fn filters_mut(&mut self) -> &mut Vec<FilterCondition>
fn filters_mut(&mut self) -> &mut Vec<FilterCondition>
Get a mutable reference to the filter list.
Source§fn params_mut(&mut self) -> &mut ParamStore
fn params_mut(&mut self) -> &mut ParamStore
Get a mutable reference to the parameter store.
Source§fn eq(self, column: &str, value: impl IntoSqlParam) -> Self
fn eq(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column = value
Source§fn neq(self, column: &str, value: impl IntoSqlParam) -> Self
fn neq(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column != value
Source§fn gt(self, column: &str, value: impl IntoSqlParam) -> Self
fn gt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column > value
Source§fn gte(self, column: &str, value: impl IntoSqlParam) -> Self
fn gte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column >= value
Source§fn lt(self, column: &str, value: impl IntoSqlParam) -> Self
fn lt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column < value
Source§fn lte(self, column: &str, value: impl IntoSqlParam) -> Self
fn lte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column <= value
Source§fn like(self, column: &str, pattern: impl IntoSqlParam) -> Self
fn like(self, column: &str, pattern: impl IntoSqlParam) -> Self
Filter: column LIKE pattern
Source§fn ilike(self, column: &str, pattern: impl IntoSqlParam) -> Self
fn ilike(self, column: &str, pattern: impl IntoSqlParam) -> Self
Filter: column ILIKE pattern (case-insensitive)
Source§fn is(self, column: &str, value: IsValue) -> Self
fn is(self, column: &str, value: IsValue) -> Self
Filter: column IS NULL / IS NOT NULL / IS TRUE / IS FALSE
Source§fn in_<V>(self, column: &str, values: Vec<V>) -> Selfwhere
V: IntoSqlParam,
fn in_<V>(self, column: &str, values: Vec<V>) -> Selfwhere
V: IntoSqlParam,
Filter: column IN (val1, val2, …)
Source§fn contains(self, column: &str, value: impl IntoSqlParam) -> Self
fn contains(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column @> value (contains)
Source§fn contained_by(self, column: &str, value: impl IntoSqlParam) -> Self
fn contained_by(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column <@ value (contained by)
Source§fn overlaps(self, column: &str, value: impl IntoSqlParam) -> Self
fn overlaps(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column && value (overlaps)
Source§fn range_gt(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_gt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column >> value (range strictly greater than)
Source§fn range_gte(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_gte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column &> value (range greater than or equal)
Source§fn range_lt(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_lt(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column << value (range strictly less than)
Source§fn range_lte(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_lte(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column &< value (range less than or equal)
Source§fn range_adjacent(self, column: &str, value: impl IntoSqlParam) -> Self
fn range_adjacent(self, column: &str, value: impl IntoSqlParam) -> Self
Filter: column -|- value (range adjacent)
Source§fn text_search(
self,
column: &str,
query: impl IntoSqlParam,
search_type: TextSearchType,
config: Option<&str>,
) -> Self
fn text_search( self, column: &str, query: impl IntoSqlParam, search_type: TextSearchType, config: Option<&str>, ) -> Self
Full-text search filter.
Source§fn not(self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>) -> Self
fn not(self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>) -> Self
Negate a filter condition using a closure.
Source§fn or_filter(
self,
f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>,
) -> Self
fn or_filter( self, f: impl FnOnce(FilterCollector<'_>) -> FilterCollector<'_>, ) -> Self
OR filter: combine multiple conditions with OR.
Source§fn match_filter(self, pairs: Vec<(&str, impl IntoSqlParam + Clone)>) -> Self
fn match_filter(self, pairs: Vec<(&str, impl IntoSqlParam + Clone)>) -> Self
Match multiple column=value pairs (all must match).
Source§impl<T> Modifiable for SelectBuilder<T>
impl<T> Modifiable for SelectBuilder<T>
Source§fn order(self, column: &str, direction: OrderDirection) -> Self
fn order(self, column: &str, direction: OrderDirection) -> Self
Order by a column.
Source§fn order_with_nulls(
self,
column: &str,
direction: OrderDirection,
nulls: NullsPosition,
) -> Self
fn order_with_nulls( self, column: &str, direction: OrderDirection, nulls: NullsPosition, ) -> Self
Order by a column with explicit nulls positioning.
Source§fn range(self, from: i64, to: i64) -> Self
fn range(self, from: i64, to: i64) -> Self
Set the range of rows to return (offset..offset+limit).
Source§fn maybe_single(self) -> Self
fn maybe_single(self) -> Self
Expect zero or one row. Returns error if >1 rows.
Source§fn count_option(self, option: CountOption) -> Self
fn count_option(self, option: CountOption) -> Self
Request a row count with a specific counting strategy.
Auto Trait Implementations§
impl<T> Freeze for SelectBuilder<T>
impl<T> !RefUnwindSafe for SelectBuilder<T>
impl<T> Send for SelectBuilder<T>where
T: Send,
impl<T> Sync for SelectBuilder<T>where
T: Sync,
impl<T> Unpin for SelectBuilder<T>where
T: Unpin,
impl<T> !UnwindSafe for SelectBuilder<T>
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