{"id":21270712,"url":"https://github.com/explodingcamera/okv","last_synced_at":"2025-10-06T16:48:33.644Z","repository":{"id":208130194,"uuid":"720881094","full_name":"explodingcamera/okv","owner":"explodingcamera","description":"A versatile key-value storage library for Rust","archived":false,"fork":false,"pushed_at":"2024-10-21T01:01:16.000Z","size":576,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-21T04:27:26.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/okv","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/explodingcamera.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}},"created_at":"2023-11-19T21:45:25.000Z","updated_at":"2024-10-21T01:01:20.000Z","dependencies_parsed_at":"2024-03-20T21:40:10.697Z","dependency_job_id":"cd082e87-d258-4588-a6af-f4bfe48be799","html_url":"https://github.com/explodingcamera/okv","commit_stats":null,"previous_names":["explodingcamera/okv"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explodingcamera%2Fokv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explodingcamera%2Fokv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explodingcamera%2Fokv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/explodingcamera%2Fokv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/explodingcamera","download_url":"https://codeload.github.com/explodingcamera/okv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225681161,"owners_count":17507214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-21T08:18:23.298Z","updated_at":"2025-10-06T16:48:33.544Z","avatar_url":"https://github.com/explodingcamera.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv\u003e\n  \u003cimg align=\"left\" src=\"./okv.png\" width=\"100px\"\u003e\n  \u003ch1\u003eOKV: Okay Key-Value Storage\u003c/h1\u003e\n\u003c/div\u003e\n \n[![docs.rs](https://img.shields.io/docsrs/okv?logo=rust)](https://docs.rs/okv) [![Crates.io](https://img.shields.io/crates/v/okv.svg?logo=rust)](https://crates.io/crates/okv) [![Crates.io](https://img.shields.io/crates/l/okv.svg)](./LICENSE-APACHE)\n\n\u003e [!WARNING]  \n\u003e The `main` branch contains the latest development changes and is not available for use.\n\nOKV has provides a single, unified API for working with key-value storage, regardless of the underlying database. You get the flexibility to support multiple databases and serialization formats without changing your code, and no more fighting with async/await, lifetimes, or complex database APIs. Serialization is handled automatically, with whatever format you choose, with JSON and MessagePack supported out of the box and great serde support.\n\n## Features\n\n- **Multiple Database Backends**:\n  - `memdb`: Pretty much just a HashMap that supports multithreading, for testing and prototyping\n  - `rocksdb`: RocksDB integration for robust, disk-based storage\n  - `redb`: Pure Rust embedded database inspired by lmdb\n  - `cloudflare`: Cloudflare KV and D1 storage for serverless applications, from workers or using the http API\n    \u003c!-- - `sqlite`: SQLite support for relational data storage. --\u003e\n- **Serialization Formats**:\n  - `serde_json`: JSON serialization for human-readable data storage\n  - `rmp-serde`: MessagePack serialization for efficient binary data storage\n  - _or bring your own format_\n- **Robust API**:\n  - **helpers** for common operations\n  - **transactions** for consistency (cross-database transactions are not supported yet)\n  - **iterators** for efficient data access\n  - **sync** and **async** APIs\n  - **direct access** to the underlying database for advanced use cases\n\n## Installation\n\nAdd OKV to your project:\n\n```bash\ncargo add okv\n```\n\n# Quick Start\n\n```rust\nuse okv::{Env};\nuse okv::backend::memory::MemDB;\n\nfn main() -\u003e eyre::Result\u003c()\u003e {\n    // initialize the storage backend\n    let memdb = MemDB::new();\n    let env = Env::new(memdb);\n\n    // open a database with the specified key and value types\n    let db = env.open::\u003c\u0026str, \u0026str\u003e(\"my_database\")?;\n\n    // Working with data\n    db.set_nx(\"key\", \"val\")?;\n    assert_eq!(db.get(\"key\")?, Some(\"val\".to_string()));\n\n    Ok(())\n}\n```\n\n# Supported Types\n\nOKV can work with any type that implements `serde::Serialize`/`serde::Deserialize`. Additionally, it supports the following types out of the box without any serialization overhead:\n\n- Integer types: [`u8`], [`u16`], [`u32`], [`u64`], [`u128`], [`i8`], [`i16`], [`i32`], [`i64`], [`i128`]\n- Basic types: `()`, [`\u0026str`], [`String`], [`bool`]\n- Binary data: any type that implements `AsRef\u003c[u8]\u003e` like [`Vec\u003cu8\u003e`], [`\u0026[u8]`]\n\nIf you want to update a type later, I recommend [obake](https://crates.io/crates/obake) that adds versioning and migration support on a per key basis and works well with OKV.\n\n# Versioning\n\nOKV follows [Semantic Versioning](https://semver.org/), but only changes to the user-facing API are considered breaking changes. `okv_core` can have breaking changes in minor versions, so when using the backends directly, their version should match the version of `okv`.\n\n# License\n\nLicensed under either of [Apache License, Version 2.0](./LICENSE-APACHE) or [MIT license](./LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in OKV by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexplodingcamera%2Fokv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexplodingcamera%2Fokv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexplodingcamera%2Fokv/lists"}