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