{"id":50337367,"url":"https://github.com/amimart/colette","last_synced_at":"2026-05-29T14:30:47.915Z","repository":{"id":359203952,"uuid":"1244988860","full_name":"amimart/colette","owner":"amimart","description":"Colette - Typed collections, indexes and scans over KV stores","archived":false,"fork":false,"pushed_at":"2026-05-20T23:42:38.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-21T02:12:54.117Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amimart.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":null,"dco":null,"cla":null}},"created_at":"2026-05-20T19:54:27.000Z","updated_at":"2026-05-20T23:52:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/amimart/colette","commit_stats":null,"previous_names":["amimart/colette"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/amimart/colette","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amimart%2Fcolette","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amimart%2Fcolette/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amimart%2Fcolette/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amimart%2Fcolette/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amimart","download_url":"https://codeload.github.com/amimart/colette/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amimart%2Fcolette/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33657690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2026-05-29T14:30:46.795Z","updated_at":"2026-05-29T14:30:47.909Z","avatar_url":"https://github.com/amimart.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Colette\n\n![Status](https://img.shields.io/badge/status-🚧%20WIP-yellow?style=for-the-badge)\n[![lint](https://img.shields.io/github/actions/workflow/status/amimart/colette/lint.yaml?label=lint\u0026style=for-the-badge\u0026logo=github)](https://github.com/amimart/colette/actions/workflows/lint.yaml)\n[![build](https://img.shields.io/github/actions/workflow/status/amimart/colette/build.yaml?label=build\u0026style=for-the-badge\u0026logo=github)](https://github.com/amimart/colette/actions/workflows/build.yaml)\n[![test](https://img.shields.io/github/actions/workflow/status/amimart/colette/test.yaml?label=test\u0026style=for-the-badge\u0026logo=github)](https://github.com/amimart/colette/actions/workflows/test.yaml)\n\nColette - Typed collections, indexes and scans over KV stores\n\n## Purpose\n\nColette aims to fill the gap between low-level embedded key-value stores and heavier SQL/ORM-based solutions.\n\nColette is designed as a lightweight typed storage layer on top of ordered KV stores, focused on:\n\n* typed records;\n* indexes;\n* prefix range scans;\n* cursor-based pagination;\n* zero-copy/zero-alloc friendly;\n* multi-backend support;\n\nThe goal is not to build:\n\n* an ORM;\n* a query planner;\n* or a database server;\n\n## Status\n\n🚧 Under active Design, you'll find below some first sketches:\n\n### Collection definition\n\n```rust\nlet downloads = collection::\u003cDownload, DB\u003e(\"downloads\", DB {})\n    .with_index::\u003cUniqueName\u003e()\n    .with_index::\u003cByStatus\u003e()\n    .with_index::\u003cByStatusAndSize\u003e()\n    build();\n\ndownloads.save(dl)?;\nlet my_dl = downloads.get(\u0026dl.info_hash)?;\n```\n\n### Index scans\n\n```rust\ndownloads.index(ByStatusAndSize).?\n    .prefix_range(\n        Bound::Included((Status::InProgress, 0))..Bound::Excluded((Status::InProgress, 1000000))\n    ).direction(Direction::LeftToRight)\n    .after(cursor)\n    .iter();\n```\n\n### Entity definition\n\n```rust\npub struct Download {\n    id: InfoHash,\n    name: String,\n    status: Status,\n    size: u64,\n}\n\n#[derive(Clone, Copy, Eq, PartialEq)]\npub struct InfoHash([u8; 20]);\n\n#[derive(Clone, Copy, Eq, PartialEq)]\npub enum Status {\n    Queued,\n    Submitted,\n    InProgress,\n    Completed,\n}\n\nimpl_enum_key!(Status as u8 {\n    Status::Queued =\u003e 0,\n    Status::Submitted =\u003e 1,\n    Status::InProgress =\u003e 2,\n    Status::Completed =\u003e 3,\n});\n\nimpl Entity for Download {\n    type Key\u003c'a\u003e\n        = \u0026'a [u8; 20] // key extraction is zero-copy, encoding is zero-alloc\n    where\n        Self: 'a;\n\n    fn key(\u0026self) -\u003e Self::Key\u003c'_\u003e {\n        \u0026self.id.0\n    }\n\n    fn to_bytes(\u0026self) -\u003e Result\u003cVec\u003cu8\u003e, CodecError\u003e {\n        todo!()\n    }\n\n    fn from_bytes(_bytes: \u0026[u8]) -\u003e Result\u003cSelf, CodecError\u003e {\n        todo!()\n    }\n}\n```\n\n### Index definition\n\n```rust\npub struct UniqueName;\nimpl Index\u003cDownload\u003e for UniqueName {\n    type Key\u003c'a\u003e = \u0026'a str; // key extraction is zero-copy, encoding may be zero-alloc\n    type Kind\u003c'a\u003e = Unique;\n    const NAME: \u0026'static str = \"name\";\n\n    fn key(entity: \u0026Download) -\u003e Self::Key\u003c'_\u003e {\n        entity.name.as_str()\n    }\n}\n\npub struct ByStatus;\nimpl Index\u003cDownload\u003e for ByStatus {\n    type Key\u003c'a\u003e = (Status,); // key extraction is copy, encoding is zero-alloc\n    type Kind\u003c'a\u003e = Multi;\n    const NAME: \u0026'static str = \"status\";\n\n    fn key(entity: \u0026Download) -\u003e Self::Key\u003c'_\u003e {\n        (entity.status,)\n    }\n}\n\npub struct ByStatusAndSize;\nimpl Index\u003cDownload\u003e for ByStatusAndSize {\n    type Key\u003c'a\u003e = (Status, u64); // key extraction is copy, encoding may be zero-alloc\n    type Kind\u003c'a\u003e = Multi;\n    const NAME: \u0026'static str = \"status_size\";\n\n    fn key(entity: \u0026Download) -\u003e Self::Key\u003c'_\u003e {\n        (entity.status, entity.size)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famimart%2Fcolette","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famimart%2Fcolette","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famimart%2Fcolette/lists"}