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;
50pub mod locks;
51pub mod lock_query;
52pub mod lock_lazy;
53pub mod lock_join;
54pub mod lock_view;
55
56#[macro_use]
57pub mod macros;
58
59pub use query::{Query, QueryWithSkip};
60pub use join::JoinQuery;
61pub use lazy::LazyQuery;
62pub use queryable::Queryable;
63pub use ext::QueryExt;
64pub use locks::{LockValue, LockQueryExt, LockIterExt, LockedValueRef};
65pub use lock_query::{LockQuery, LockQueryable, LockLazyQueryable};
66pub use lock_lazy::LockLazyQuery;
67pub use lock_join::{LockJoinQuery, LockJoinable, LockJoinableCollection};
68pub use lock_view::{LockView, MaterializedLockView};
69
70// Re-export key-paths for convenience
71pub use key_paths_core::KeyPaths;