rust_queries_core/lib.rs
1//! # Rust Query Builder Core
2//!
3//! Core functionality for rust-queries-builder - a powerful, type-safe query builder
4//! library for Rust that leverages key-paths for SQL-like operations on in-memory collections.
5//!
6//! This crate contains the core query building logic, without proc-macros or derive functionality.
7//!
8//! ## Features
9//!
10//! - Type-safe queries with compile-time checking
11//! - SQL-like operations: WHERE, SELECT, ORDER BY, GROUP BY, JOIN
12//! - Rich aggregations: COUNT, SUM, AVG, MIN, MAX
13//! - Pagination: LIMIT and SKIP
14//! - Join operations: INNER, LEFT, RIGHT, CROSS
15//! - Zero-cost abstractions
16//! - Clone-free operations
17//! - Lazy evaluation with early termination
18//! - Extension traits for ergonomic API
19//! - Helper macros to reduce boilerplate
20//!
21//! ## Example
22//!
23//! ```rust
24//! use rust_queries_core::{Query, QueryExt};
25//! use key_paths_derive::Keypaths;
26//!
27//! #[derive(Keypaths)]
28//! struct Product {
29//! id: u32,
30//! name: String,
31//! price: f64,
32//! }
33//!
34//! let products = vec![
35//! Product { id: 1, name: "Laptop".to_string(), price: 999.99 },
36//! Product { id: 2, name: "Mouse".to_string(), price: 29.99 },
37//! ];
38//!
39//! // Using extension trait
40//! let query = products.query().where_(Product::price_r(), |&p| p > 100.0);
41//! let expensive = query.all();
42//! ```
43
44pub mod query;
45pub mod join;
46pub mod lazy;
47pub mod queryable;
48pub mod ext;
49pub mod datetime;
50
51#[macro_use]
52pub mod macros;
53
54pub use query::{Query, QueryWithSkip};
55pub use join::JoinQuery;
56pub use lazy::LazyQuery;
57pub use queryable::Queryable;
58pub use ext::QueryExt;
59
60// Re-export key-paths for convenience
61pub use key_paths_core::KeyPaths;