Skip to main content

chronix_core/
lib.rs

1//! # chronix-core
2//!
3//! Core data model, types, errors, and configuration for the Chronix time-series
4//! database. This crate provides the foundational types that all other Chronix
5//! crates depend on.
6//!
7//! ## Overview
8//!
9//! - **Data model:** [`FieldValue`], [`SeriesKey`], [`Point`] — the fundamental
10//!   units of time-series data.
11//! - **Schema:** [`MeasurementSchema`], [`SchemaRegistry`] — schema-on-write with
12//!   additive evolution.
13//! - **Errors:** [`ChronixError`] — crate-level and top-level error hierarchy.
14//! - **Configuration:** [`ChronixConfig`], [`WalConfig`] — full database
15//!   configuration with builder pattern.
16
17#![warn(missing_docs)]
18#![deny(unsafe_code)]
19#![allow(clippy::module_name_repetitions)]
20
21pub mod config;
22pub mod error;
23pub mod schema;
24pub mod types;
25pub mod wal_codec;
26
27pub use config::{
28    AnalyticsConfig, ChronixConfig, ChronixConfigBuilder, CompressionCodec, FloatEncoding,
29    FsyncPolicy, WalConfig,
30};
31pub use error::{ChronixError, ConfigError, SchemaError, WalError};
32pub use schema::{
33    ColumnDef, ColumnRole, ColumnType, MeasurementSchema, SchemaAction, SchemaRegistry,
34};
35pub use types::{
36    canonical_from_pairs, push_canonical, FieldValue, Fields, NamespaceId, NamespaceQuota,
37    NamespaceUsage, Point, SegmentId, SegmentState, SeriesKey, ShardId, Tags, Timestamp, Tombstone,
38    TombstoneSet, WalEntry, KV_SEPARATOR, MAX_STRING_FIELD_LENGTH, NAMESPACE_TAG,
39    RESERVED_COLUMN_NAMES, TAG_SEPARATOR, TIME_COLUMN,
40};
41pub use wal_codec::{
42    decode as wal_decode, encode as wal_encode, encode_write_point as wal_encode_write_point,
43    CodecError as WalCodecError,
44};