{"id":33659644,"url":"https://github.com/dragginzgame/icydb","last_synced_at":"2026-01-13T13:59:05.396Z","repository":{"id":325917999,"uuid":"1104724435","full_name":"dragginzgame/icydb","owner":"dragginzgame","description":"ic database","archived":false,"fork":false,"pushed_at":"2026-01-12T13:52:56.000Z","size":8832,"stargazers_count":7,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-12T19:38:33.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dragginzgame.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-11-26T15:47:20.000Z","updated_at":"2026-01-12T13:53:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dragginzgame/icydb","commit_stats":null,"previous_names":["dragginzgame/icydb"],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/dragginzgame/icydb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragginzgame%2Ficydb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragginzgame%2Ficydb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragginzgame%2Ficydb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragginzgame%2Ficydb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dragginzgame","download_url":"https://codeload.github.com/dragginzgame/icydb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragginzgame%2Ficydb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28387596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T13:42:20.960Z","status":"ssl_error","status_checked_at":"2026-01-13T13:42:03.276Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-02T22:00:35.454Z","updated_at":"2026-01-13T13:59:05.376Z","avatar_url":"https://github.com/dragginzgame.png","language":"Rust","funding_links":[],"categories":["Storage and Databases"],"sub_categories":["Candid implementations"],"readme":"\n![MSRV](https://img.shields.io/badge/rustc-1.91+-blue.svg)\n[![CI](https://github.com/dragginzgame/icydb/actions/workflows/ci.yml/badge.svg)](https://github.com/dragginzgame/icydb/actions/workflows/ci.yml)\n[![License: MIT/Apache-2.0](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue)](LICENSE-APACHE)\n[![Crate](https://img.shields.io/crates/v/icydb.svg)](https://crates.io/crates/icydb)\n[![Docs](https://img.shields.io/docsrs/icydb)](https://docs.rs/icydb)\n\n# IcyDB — Data Model Framework for the Internet Computer\n\n\u003cimg src=\"assets/icydblogo.svg\" alt=\"IcyDB logo\" width=\"220\"/\u003e \u003cimg src=\"assets/swampfree.png\" alt=\"100% Certified Swamp-Free\" width=\"120\"/\u003e\n\n\u003e Battle-tested, schema-first data models for Internet Computer canisters. Built for [Dragginz](https://dragginz.io/), now open to everyone.\n\n## 👋 Overview\n\n**IcyDB** is a Rust framework for building strongly-typed, queryable data models on the [Internet Computer](https://internetcomputer.org).\n\n---\n\n## ✨ Highlights\n\n- **Entity macros** – define entities declaratively with schema attributes.\n- **Query builder** – type-safe filters, sorting, offsets, limits.\n- **Stable storage** – powered by `ic-stable-structures` B-Trees with predictable costs.\n- **Path dispatch** – `icydb_build` generates internal dispatch helpers so you can map paths to entity types without exposing global endpoints.\n- **Observability endpoints** – `icydb_snapshot`, `icydb_logs`, `icydb_metrics`, `icydb_metrics_reset` ship automatically.\n- **Integration with IC canisters** – ergonomic `icydb_start!` and `icydb_build!` macros.\n- **Testability** – fixtures, query validation, index testing utilities.\n\n---\n\n## ⚡ Quickstart\n\n1. **Install Rust 1.91.1+** (workspace uses edition 2024).\n2. **Add IcyDB** to your `Cargo.toml` using the latest tag:\n   ```toml\n   [dependencies]\n   icydb = { git = \"https://github.com/dragginzgame/icydb.git\", tag = \"v0.0.1\" }\n   ```\n3. **Declare an entity** with the `#[entity]` macro and a primary key.\n4. **Query your data** via `db!().load::\u003cEntity\u003e()...`.\n\nSee [INTEGRATION.md](INTEGRATION.md) for pinning strategies, feature flags, and troubleshooting tips.\n\n---\n\n## 🚀 Example\n\n### Define an entity\n\n```rust\n/// Rarity\n/// Affects the chance of an item dropping or an event occurring.\n#[entity(\n    sk(field = \"id\"),\n    fields(\n        field(ident = \"id\", value(item(is = \"types::Ulid\"))),\n        field(ident = \"name\", value(item(is = \"text::Name\"))),\n        field(ident = \"description\", value(item(is = \"text::Description\"))),\n        field(ident = \"order\", value(item(is = \"game::Order\"))),\n        field(ident = \"color\", value(item(is = \"types::color::RgbHex\"))),\n    ),\n)]\npub struct Rarity {}\n```\n\n### Query entities\n\n```rust\n#[query]\npub fn rarities() -\u003e Result\u003cVec\u003cRarityView\u003e, icydb::Error\u003e {\n    let query = icydb::db::query::load()\n        .filter(|f| {\n            // (level \u003e= 2 AND level \u003c= 4) OR (name CONTAINS \"ncon\")\n            (f.gte(\"level\", 2) \u0026 f.lte(\"level\", 4)) | f.contains(\"name\", \"ncon\")\n        })\n        .sort(|s| s.desc(\"level\"))\n        .limit(100);\n\n    let rows = db().load::\u003cRarity\u003e().debug().execute(\u0026query)?;\n    Ok(rows.views())\n}\n```\n\n---\n\n## 🏗️ Project Layout\n\n- `icydb/` — meta crate re-exporting everything for downstream users.\n- `crates/icydb-core` — runtime (entities, traits, filters, query engine, stores).\n- `crates/icydb-macros` — proc-macros that generate schema, traits, and views.\n- `crates/icydb-schema` — schema AST, builder, and validation.\n- `crates/icydb-base` — built-in design types/sanitizers/validators.\n- `crates/icydb-error` — shared error types (e.g., `ErrorTree`).\n- `crates/icydb-build` — build-time codegen for actors/queries/metrics.\n- `crates/test` and `crates/test_design` — integration and design tests.\n- `assets/`, `scripts/`, `Makefile` — docs, helper scripts, and workspace tasks.\n\n---\n\n## 📟 Observability \u0026 Tooling\n\n- `icydb_snapshot()` → live `StorageReport` with data/index/state breakdowns.\n- `icydb_logs()` → in-memory log buffer (oldest → newest).\n- `icydb_metrics()` → `EventReport` for counters since `since_ms`.\n- `icydb_metrics_reset()` → clears metrics state.\n\nExamples:\n```bash\ndfx canister call \u003ccanister\u003e icydb_snapshot\ndfx canister call \u003ccanister\u003e icydb_logs\ndfx canister call \u003ccanister\u003e icydb_metrics\ndfx canister call \u003ccanister\u003e icydb_metrics_reset\n```\n\n---\n\n## 🧑‍💻 Local Development\n\nWorkspace commands (see `Makefile`):\n\n```bash\nmake check      # type-check workspace\nmake clippy     # lint with warnings denied\nmake test       # run all unit + integration tests\nmake fmt        # format the workspace (or fmt-check to verify)\nmake build      # release build\n```\n\nPre-commit hooks run `cargo fmt -- --check`, `cargo sort --check`, and `cargo sort-derives --check`. Run any of the `make fmt*`, `make clippy`, or `make check` targets once to auto-install and enable them.\n\n### Style \u0026 conventions\n\n- Prefer `?` + typed errors (`thiserror`) instead of panics in library code.\n- Keep functions focused; extract helpers when logic grows.\n- Import ergonomically: group paths per crate (e.g., `use crate::{db, design};`).\n- Use saturating arithmetic for counters and totals.\n- Co-locate small unit tests; integration/design tests live in `crates/test` and `crates/test_design`.\n- No backward-compatibility promise yet—document breaking changes in the changelog.\n\n---\n\n## 🤝 Contributing \u0026 Support\n\nWe welcome issues, discussions, and pull requests now that the repository is public. To contribute:\n\n1. Fork and clone the repo.\n2. Install the toolchain (`rustup toolchain install 1.91.1`).\n3. Run `make fmt-check \u0026\u0026 make clippy \u0026\u0026 make check \u0026\u0026 make test` before opening a PR.\n4. Document user-visible changes in [CHANGELOG.md](CHANGELOG.md) under the latest heading.\n\nNeed help? Start with [INTEGRATION.md](INTEGRATION.md), [VERSIONING.md](VERSIONING.md), or open a GitHub issue.\n\n---\n\n## 📊 Current Focus\n\n- Expanding documentation and runnable examples.\n- Deepening test coverage across entity indexes and query paths.\n- Tracking store statistics \u0026 memory usage in production deployments.\n- Reducing WASM size produced by `icydb_build`.\n\n---\n\n## 📄 License\n\nLicensed under either of:\n\n- Apache License, Version 2.0 (`LICENSE-APACHE`)\n- MIT license (`LICENSE-MIT`)\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragginzgame%2Ficydb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragginzgame%2Ficydb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragginzgame%2Ficydb/lists"}