pub struct DatabaseQuery { /* private fields */ }Expand description
Represents a composable database query, analogous to the JS QueryImpl
(packages/database/src/api/Reference_impl.ts).
Implementations§
Source§impl DatabaseQuery
impl DatabaseQuery
Sourcepub fn reference(&self) -> &DatabaseReference
pub fn reference(&self) -> &DatabaseReference
Exposes the underlying reference backing this query.
Sourcepub fn order_by_child(self, path: &str) -> DatabaseResult<Self>
pub fn order_by_child(self, path: &str) -> DatabaseResult<Self>
Orders children by the given path, mirroring orderByChild().
Sourcepub fn order_by_key(self) -> DatabaseResult<Self>
pub fn order_by_key(self) -> DatabaseResult<Self>
Orders children by key, mirroring orderByKey().
Sourcepub fn order_by_value(self) -> DatabaseResult<Self>
pub fn order_by_value(self) -> DatabaseResult<Self>
Orders children by value, mirroring orderByValue().
Sourcepub fn order_by_priority(self) -> DatabaseResult<Self>
pub fn order_by_priority(self) -> DatabaseResult<Self>
Orders children by priority, mirroring orderByPriority().
Sourcepub fn start_at(self, value: Value) -> DatabaseResult<Self>
pub fn start_at(self, value: Value) -> DatabaseResult<Self>
Applies a startAt() constraint to the query.
Sourcepub fn start_at_with_key(
self,
value: Value,
name: Option<String>,
) -> DatabaseResult<Self>
pub fn start_at_with_key( self, value: Value, name: Option<String>, ) -> DatabaseResult<Self>
Applies a keyed startAt(value, name) constraint to the query.
Sourcepub fn start_after(self, value: Value) -> DatabaseResult<Self>
pub fn start_after(self, value: Value) -> DatabaseResult<Self>
Applies a startAfter() constraint to the query.
Sourcepub fn start_after_with_key(
self,
value: Value,
name: Option<String>,
) -> DatabaseResult<Self>
pub fn start_after_with_key( self, value: Value, name: Option<String>, ) -> DatabaseResult<Self>
Applies a keyed startAfter(value, name) constraint to the query.
Sourcepub fn end_at(self, value: Value) -> DatabaseResult<Self>
pub fn end_at(self, value: Value) -> DatabaseResult<Self>
Applies an endAt() constraint to the query.
Sourcepub fn end_at_with_key(
self,
value: Value,
name: Option<String>,
) -> DatabaseResult<Self>
pub fn end_at_with_key( self, value: Value, name: Option<String>, ) -> DatabaseResult<Self>
Applies a keyed endAt(value, name) constraint to the query.
Sourcepub fn end_before(self, value: Value) -> DatabaseResult<Self>
pub fn end_before(self, value: Value) -> DatabaseResult<Self>
Applies an endBefore() constraint to the query.
Sourcepub fn end_before_with_key(
self,
value: Value,
name: Option<String>,
) -> DatabaseResult<Self>
pub fn end_before_with_key( self, value: Value, name: Option<String>, ) -> DatabaseResult<Self>
Applies a keyed endBefore(value, name) constraint to the query.
Sourcepub fn limit_to_first(self, limit: u32) -> DatabaseResult<Self>
pub fn limit_to_first(self, limit: u32) -> DatabaseResult<Self>
Applies limitToFirst() to the query.
Sourcepub fn limit_to_last(self, limit: u32) -> DatabaseResult<Self>
pub fn limit_to_last(self, limit: u32) -> DatabaseResult<Self>
Applies limitToLast() to the query.
Sourcepub fn equal_to(self, value: Value) -> DatabaseResult<Self>
pub fn equal_to(self, value: Value) -> DatabaseResult<Self>
Applies equalTo() to the query.
Sourcepub fn equal_to_with_key(
self,
value: Value,
name: Option<String>,
) -> DatabaseResult<Self>
pub fn equal_to_with_key( self, value: Value, name: Option<String>, ) -> DatabaseResult<Self>
Applies a keyed equalTo(value, name) constraint to the query.
Sourcepub async fn get(&self) -> DatabaseResult<Value>
pub async fn get(&self) -> DatabaseResult<Value>
Executes the query and returns the JSON payload, mirroring JS get().
Sourcepub async fn on_value<F>(
&self,
callback: F,
) -> DatabaseResult<ListenerRegistration>
pub async fn on_value<F>( &self, callback: F, ) -> DatabaseResult<ListenerRegistration>
Registers a value listener for this query, mirroring onValue(query, cb).
Trait Implementations§
Source§impl Clone for DatabaseQuery
impl Clone for DatabaseQuery
Source§fn clone(&self) -> DatabaseQuery
fn clone(&self) -> DatabaseQuery
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more