rhei_core/lib.rs
1//! Core traits and types for the Rhei HTAP engine.
2//!
3//! `rhei-core` is the **foundation crate** of the Rhei workspace. Every other
4//! crate depends on it for shared abstractions. It deliberately has no
5//! dependencies on concrete database drivers so that it can be compiled
6//! quickly and used as a pure trait/type boundary.
7//!
8//! # Position in the HTAP pipeline
9//!
10//! ```text
11//! Client
12//! |
13//! v
14//! HtapEngine (crates/rhei)
15//! |-- QueryRouter ──────────────────── routes SQL to OLTP or OLAP
16//! |-- OltpEngine ──────────────────── transactional reads/writes
17//! |-- OlapEngine ──────────────────── analytical queries
18//! |-- CdcConsumer ──────────────────── polls change-data-capture events
19//! +-- SyncEngine ──────────────────── applies CDC events to OLAP
20//! ```
21//!
22//! # Key types
23//!
24//! | Item | Description |
25//! |------|-------------|
26//! | [`OltpEngine`] | Async trait for transactional SQL execution |
27//! | [`OlapEngine`] | Async trait for analytical SQL + Arrow bulk-load |
28//! | [`CdcConsumer`] | Async trait for polling CDC events |
29//! | [`SyncEngine`] | Async trait for the CDC→OLAP sync loop |
30//! | [`QueryRouter`] | Sync trait that classifies SQL to [`QueryTarget`] |
31//! | [`SchemaRegistry`] | Thread-safe registry of [`TableSchema`]s |
32//! | [`CdcEvent`] | A single change-data-capture event |
33//! | [`SyncMode`] | Destructive mirror vs. SCD Type 2 temporal history |
34//! | [`RecordBatchBoxStream`] | Streaming Arrow record-batch type |
35
36pub mod error;
37pub mod schema;
38pub mod traits;
39pub mod types;
40
41pub use error::CoreError;
42pub use schema::{validate_identifier, SchemaRegistry, TableSchema};
43pub use traits::cdc::CdcConsumer;
44pub use traits::olap::{vec_to_stream, OlapEngine, RecordBatchBoxStream};
45pub use traits::oltp::OltpEngine;
46pub use traits::router::QueryRouter;
47pub use traits::sync::SyncEngine;
48pub use types::*;