Skip to main content

sim_relation_core/
lib.rs

1//! Open relational records built directly on the kernel data substrate.
2//!
3//! A logical domain is a [`DomainSpec`] in a [`DomainCatalog`], not an enum
4//! variant. Storage providers consume its [`StorageRepr`], while runtime Shape
5//! resolution is deliberately left to `sim-relation-shape`.
6//!
7//! ```
8//! use sim_kernel::{Ref, Symbol};
9//! use sim_relation_core::{DomainCatalog, DomainId, DomainSpec, DomainTrait, StorageRepr};
10//!
11//! let uuid = DomainSpec::new(
12//!     DomainId::new(Symbol::qualified("example", "uuid")).unwrap(),
13//!     StorageRepr::Text,
14//!     Ref::Symbol(Symbol::qualified("example", "UuidShape")),
15//!     [DomainTrait::Equatable, DomainTrait::Ordered],
16//! ).unwrap();
17//! let catalog = DomainCatalog::new([uuid]).unwrap();
18//! assert!(catalog.get(&DomainId::new(Symbol::qualified("example", "uuid")).unwrap()).is_some());
19//! ```
20
21#![forbid(unsafe_code)]
22#![deny(missing_docs)]
23
24mod domain;
25mod names;
26mod record;
27
28pub use domain::{
29    BaseDomain, DomainCatalog, DomainError, DomainSpec, DomainTrait, StorageRepr, StorageValue,
30};
31pub use names::{
32    BindingName, ColumnName, ConstraintName, DomainId, FieldName, IndexName, NameError,
33    ParameterName, ProviderName, RevisionName, SchemaName, SourceName, TableName, ViewName,
34};
35pub use record::{Cell, FieldType, RelationId, Row, RowError, RowType, ToRelationDatum};