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//! Type erasure for cross-driver work lives one layer up in [`vantage-vista`](https://docs.rs/vantage-vista):
8//! wrap any typed `Table<T, E>` with `T::vista_factory().from_table(...)` to get a `Vista`
9//! that talks `Record<ciborium::Value>` regardless of the underlying driver.
10//!
11//! ## Example
12//!
13//! ```rust,ignore
14//! use vantage_table::{Table, Column, EmptyEntity};
15//! use vantage_expressions::expr;
16//!
17//! // Create a new table with a datasource
18//! let mut table = Table::new("users", my_datasource);
19//!
20//! // Add columns
21//! table.add_column(Column::new("name"));
22//! table.add_column(Column::new("email").with_alias("user_email"));
23//!
24//! // Add conditions
25//! table.add_condition(expr!("age > {}", 18));
26//! table.add_condition(expr!("status = {}", "active"));
27//!
28//! // Or use the builder pattern
29//! let table = Table::new("users", my_datasource)
30//! .with(|t| {
31//! t.add_column(Column::new("name"));
32//! t.add_condition(expr!("active = {}", true));
33//! });
34//! ```
35
36pub mod traits;
37
38pub mod mocks;
39
40pub mod cbor_ext;
41pub mod conditions;
42pub mod pagination;
43pub mod prelude;
44pub mod references;
45pub mod sorting;
46
47pub mod column;
48pub mod source;
49pub mod table;