Skip to main content

Crate icydb

Crate icydb 

Source
Expand description

§icydb

icydb is the public facade crate for the IcyDB runtime. It is the recommended dependency for downstream canister projects.

This crate exposes:

  • the stable runtime surface used inside canister actor code,
  • schema and design-time helpers for macros and validation,
  • and a small set of macros and entry points that wire generated code.

Low-level execution, storage, and engine internals live in icydb-core and are re-exposed selectively through stable facade modules.

§Crate layout

  • base Design-time helpers, sanitizers, and validators used by schemas and macros.

  • build Internal code generation helpers used by macros and tests (not intended for direct use).

  • traits / types / value / view / visitor Stable runtime and schema-facing building blocks used by generated code.

  • model / obs (internal) Runtime model and metrics internals. Exposed for advanced tooling only; not part of the supported semver surface.

  • error Shared error types for generated code and runtime boundaries.

  • macros Derive macros for entities, schemas, and views.

  • schema Schema AST, builders, and validation utilities.

  • db The public database façade: session handles, query builders, and typed responses.

§Preludes

  • prelude Opinionated runtime prelude for canister actor code. Intended to be glob-imported in lib.rs to keep endpoints concise.

  • design::prelude Prelude for schema and design-time code (macros, validators, and base helpers).

§Internal boundaries

Generated code targets explicit facade surfaces (traits, patch, and __macro) instead of a broad internal-export module.

Re-exports§

pub use error::Error;
pub use icydb_build as build;
pub use icydb_schema as schema;
pub use icydb_schema_derive as macros;

Modules§

base
db
design
Design Prelude For schema/design code (macros, traits, base helpers).
error
patch
prelude
Actor Prelude using _ brings traits into scope and avoids name conflicts
traits
visitor

Macros§

build
db
Access the current canister’s database session; use db!().debug() for verbose tracing.
start
Macros

Constants§

VERSION
Consts

Functions§

deserialize
Deserialize bytes into a concrete visitable value.
sanitize
Helpers
serialize
Serialize a visitable value into bytes.
validate
Validate a visitable tree, collecting issues by path.