#schema #macro #run-time #canister #facade #orm #query-api #re-exports #downstream #design-time

icydb

IcyDB — A type-safe, embedded ORM and schema system for the Internet Computer

317 releases (44 breaking)

Uses new Rust 2024

new 0.46.0 Mar 8, 2026
0.44.2 Mar 7, 2026
0.2.0 Dec 25, 2025
0.0.6 Nov 28, 2025

#9 in #query-api

Apache-2.0 OR MIT

4.5MB
111K SLoC

IcyDB

Public meta-crate for IcyDB.

This crate re-exports the IcyDB ecosystem, including runtime query APIs, schema/macros, and shared types.

Use this crate when building canister data models and queries.

For full setup, examples, and release notes:

  • Workspace README: README.md
  • Changelog: CHANGELOG.md

lib.rs:

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.

Dependencies

~8–19MB
~230K SLoC