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 cbor_ext;
39pub mod conditions;
40pub mod pagination;
41pub mod prelude;
42pub mod references;
43pub mod sorting;
44
45pub mod any;
46
47pub mod column;
48pub mod source;
49pub mod table;
50
51// TODO: Re-enable when 0.3 migration is complete
52// pub mod models_macro;
53// pub mod record;
54// pub mod references;
55// pub mod with_columns;