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(
13    all(test, not(feature = "sql")),
14    expect(
15        dead_code,
16        reason = "shared test helpers have SQL, SQL-explain, and diagnostics consumers"
17    )
18)]
19// The query-only build owns the complete engine-neutral planner/executor
20// substrate. SQL is an optional frontend over that substrate and is currently
21// the only consumer of some grouped, aggregate, cursor, and diagnostic
22// capabilities, so those internal extension points are intentionally dormant
23// when `query` is enabled without `sql`.
24#![cfg_attr(
25    all(not(test), feature = "query", not(feature = "sql")),
26    expect(
27        dead_code,
28        reason = "SQL is an optional frontend and currently consumes engine-neutral grouped, aggregate, cursor, and diagnostic capabilities not exposed by the query-only facade"
29    )
30)]
31
32extern crate self as icydb;
33
34#[macro_use]
35pub(crate) mod scalar_registry;
36
37// public exports are one module level down
38pub mod db;
39pub mod error;
40pub mod metrics;
41pub(crate) mod runtime;
42pub mod traits;
43pub mod types;
44pub mod value;
45
46#[cfg(test)]
47pub(crate) mod testing;
48
49///
50/// CONSTANTS
51///
52
53/// Maximum number of indexed fields allowed on an entity.
54///
55/// This limit keeps hashed index keys within bounded, storable sizes and
56/// simplifies sizing tests in the stores.
57pub const MAX_INDEX_FIELDS: usize = 4;
58
59///
60/// Prelude
61///
62/// Prelude contains only domain vocabulary.
63/// No errors, executors, stores, serializers, or helpers are re-exported here.
64///
65
66pub mod prelude {
67    pub use crate::{
68        traits::Path,
69        value::{InputValue, OutputValue},
70    };
71}