Skip to main content

icydb_core/
lib.rs

1//! Module: lib
2//! Responsibility: crate root for the IcyDB core runtime surface.
3//! Does not own: canister-facing facade APIs from the public `icydb` crate.
4//! Boundary: exposes the engine subsystems used by schema, query, executor, and storage layers.
5
6//! Core runtime for IcyDB: accepted-schema execution, values, storage, and
7//! the low-level vocabulary exported through the facade.
8#![warn(unreachable_pub)]
9// The no-default test target intentionally type-checks shared test/helper
10// surfaces whose consuming tests live behind SQL, SQL-explain, or diagnostics
11// features. Keep production and all-features dead-code linting strict.
12#![cfg_attr(all(test, not(feature = "sql")), allow(dead_code, unused_imports))]
13// The query-only build owns the complete engine-neutral planner/executor
14// substrate. SQL is an optional frontend over that substrate and is currently
15// the only consumer of some grouped, aggregate, cursor, and diagnostic
16// capabilities, so those internal extension points are intentionally dormant
17// when `query` is enabled without `sql`.
18#![cfg_attr(
19    all(not(test), feature = "query", not(feature = "sql")),
20    expect(
21        dead_code,
22        unused_imports,
23        reason = "SQL is an optional frontend and currently consumes engine-neutral grouped, aggregate, cursor, and diagnostic capabilities not exposed by the query-only facade"
24    )
25)]
26
27extern crate self as icydb;
28
29#[macro_use]
30pub(crate) mod scalar_registry;
31
32// public exports are one module level down
33pub mod db;
34pub mod error;
35pub mod metrics;
36pub(crate) mod runtime;
37pub mod traits;
38pub mod types;
39pub mod value;
40
41#[cfg(test)]
42pub(crate) mod testing;
43
44///
45/// CONSTANTS
46///
47
48/// Maximum number of indexed fields allowed on an entity.
49///
50/// This limit keeps hashed index keys within bounded, storable sizes and
51/// simplifies sizing tests in the stores.
52pub const MAX_INDEX_FIELDS: usize = 4;
53
54///
55/// Prelude
56///
57/// Prelude contains only domain vocabulary.
58/// No errors, executors, stores, serializers, or helpers are re-exported here.
59///
60
61pub mod prelude {
62    pub use crate::{
63        traits::Path,
64        value::{InputValue, OutputValue},
65    };
66}