Skip to main content

vantage_table/
lib.rs

1//! # Vantage Table
2//!
3//! Table = DataSet with Columns
4//!
5//! This crate provides definition for Columns, TableSource - necessary trait for Database SDKs to implement.
6//!
7//! Additionally this crate implements generic Table struct and AnyTable type-erasing wrapper.
8//!
9//! ## Example
10//!
11//! ```rust,ignore
12//! use vantage_table::{Table, Column, EmptyEntity};
13//! use vantage_expressions::expr;
14//!
15//! // Create a new table with a datasource
16//! let mut table = Table::new("users", my_datasource);
17//!
18//! // Add columns
19//! table.add_column(Column::new("name"));
20//! table.add_column(Column::new("email").with_alias("user_email"));
21//!
22//! // Add conditions
23//! table.add_condition(expr!("age > {}", 18));
24//! table.add_condition(expr!("status = {}", "active"));
25//!
26//! // Or use the builder pattern
27//! let table = Table::new("users", my_datasource)
28//!     .with(|t| {
29//!         t.add_column(Column::new("name"));
30//!         t.add_condition(expr!("active = {}", true));
31//!     });
32//! ```
33
34pub mod traits;
35
36pub mod mocks;
37
38pub mod conditions;
39pub mod pagination;
40pub mod prelude;
41pub mod references;
42pub mod sorting;
43
44pub mod any;
45
46pub mod column;
47pub mod source;
48pub mod table;
49
50// TODO: Re-enable when 0.3 migration is complete
51// pub mod models_macro;
52// pub mod record;
53// pub mod references;
54// pub mod with_columns;