Skip to main content

Module query

Module query 

Source
Expand description

§Aurora Query System

This module provides a powerful, fluent query interface for filtering, sorting, and retrieving documents from Aurora collections.

§Architectural Note: “The Query as a Stream”

Unlike traditional databases that parse SQL strings into an execution plan, Aurora’s query engine is built around the Fluent Builder Pattern and Iterators.

  1. Type-Safe Construction: Queries are built using Rust method chaining, ensuring validity at compile time (or runtime construction without parsing overhead).
  2. Zero-Allocation Filtering: The Queryable trait and DocumentFilter type allow us to stack closures. These filters run directly on the data stream without intermediate allocations.
  3. Reactive Core: The watch() method transforms a static query into a live stream of QueryUpdate events. This is the heart of the “Embedded Platform” concept—allowing the application to react to data changes instantly.

§Examples

// Get all active users over 21 let users = db.query(“users”) .filter(|f| f.eq(“status”, “active”) && f.gt(“age”, 21)) .order_by(“last_login”, false) .limit(20) .collect() .await?;

Structs§

FilterBuilder
Builder for constructing document filter expressions.
QueryBuilder
Builder for creating and executing document queries.
SearchBuilder
Builder for performing full-text search operations
SimpleQueryBuilder

Enums§

Filter

Traits§

Queryable
Trait for objects that can filter documents.