{"id":13439043,"url":"https://github.com/seladb/pickledb-rs","last_synced_at":"2025-05-16T06:07:12.925Z","repository":{"id":34015160,"uuid":"164567801","full_name":"seladb/pickledb-rs","owner":"seladb","description":"PickleDB-rs is a lightweight and simple key-value store. It is a Rust version for Python's PickleDB","archived":false,"fork":false,"pushed_at":"2024-07-12T15:39:34.000Z","size":109,"stargazers_count":263,"open_issues_count":5,"forks_count":30,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T16:04:16.365Z","etag":null,"topics":["database","db","key-value-database","kv","lightweight","nosql","nosql-database","pickledb","rust"],"latest_commit_sha":null,"homepage":"","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/seladb.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}},"created_at":"2019-01-08T05:19:51.000Z","updated_at":"2025-04-03T07:14:12.000Z","dependencies_parsed_at":"2024-09-25T01:33:15.552Z","dependency_job_id":"fd68d7f0-2b9f-4e88-b43c-0dd2d530e3bd","html_url":"https://github.com/seladb/pickledb-rs","commit_stats":{"total_commits":65,"total_committers":9,"mean_commits":7.222222222222222,"dds":0.4461538461538461,"last_synced_commit":"fcce2a32e1cbfc57fc8aacd3f1b09870ba59eacb"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seladb%2Fpickledb-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seladb%2Fpickledb-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seladb%2Fpickledb-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seladb%2Fpickledb-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seladb","download_url":"https://codeload.github.com/seladb/pickledb-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478190,"owners_count":22077676,"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":["database","db","key-value-database","kv","lightweight","nosql","nosql-database","pickledb","rust"],"created_at":"2024-07-31T03:01:10.680Z","updated_at":"2025-05-16T06:07:07.908Z","avatar_url":"https://github.com/seladb.png","language":"Rust","funding_links":[],"categories":["Libraries","库 Libraries","库","rust","Rust"],"sub_categories":["Database","数据库 Database","数据库"],"readme":"# PickleDB\r\n\r\n[![Rust test](https://github.com/seladb/pickledb-rs/workflows/Rust%20test/badge.svg)](https://github.com/seladb/pickledb-rs/actions?query=workflow%3A%22Rust+test%22)\r\n[![Rust audit](https://github.com/seladb/pickledb-rs/workflows/Rust%20audit/badge.svg)](https://github.com/seladb/pickledb-rs/actions?query=workflow%3A%22Rust+audit%22)\r\n[![Crate](https://img.shields.io/crates/v/pickledb.svg)](https://crates.io/crates/pickledb)\r\n[![API](https://docs.rs/pickledb/badge.svg)](https://docs.rs/pickledb)\r\n\r\nPickleDB is a lightweight and simple key-value store written in Rust, heavily inspired by [Python's PickleDB](https://pythonhosted.org/pickleDB/)\r\n\r\n## PickleDB is fun and easy to use\r\n\r\n```rust\r\nuse pickledb::{PickleDb, PickleDbDumpPolicy, SerializationMethod};\r\n\r\nfn main() {\r\n\r\n    // create a new DB with AutoDump (meaning every change is written to the file)\r\n    // and with Json serialization (meaning DB will be dumped to file as a Json object)\r\n    let mut db = PickleDb::new(\"example.db\", PickleDbDumpPolicy::AutoDump, SerializationMethod::Json);\r\n\r\n    // set the value 100 to the key 'key1'\r\n    db.set(\"key1\", \u0026100).unwrap();\r\n\r\n    // print the value of key1\r\n    println!(\"The value of key1 is: {}\", db.get::\u003ci32\u003e(\"key1\").unwrap());\r\n\r\n    // load the DB from the same file\r\n    let db2 = PickleDb::load(\"example.db\", PickleDbDumpPolicy::DumpUponRequest, SerializationMethod::Json).unwrap();\r\n\r\n    // print the value of key1\r\n    println!(\"The value of key1 as loaded from file is: {}\", db2.get::\u003ci32\u003e(\"key1\").unwrap());\r\n}\r\n```\r\n\r\n## Installation\r\n\r\nThis crate works with Cargo and can be found in [crates.io](https://crates.io/crates/pickledb)\r\nAdd this to your `Cargo.toml`:\r\n\r\n```toml\r\n[dependencies]\r\npickledb = \"0.5.1\"\r\n```\r\n\r\n## Documentation\r\n\r\nAll documentation for this crate can be found in [docs.rs](https://docs.rs/pickledb)\r\n\r\n## Examples\r\n\r\nThere are currently two examples shipped with PickleDB:\r\n\r\n- [Hello World](https://github.com/seladb/pickledb-rs/tree/master/examples/hello_world) which shows the basic usage of PickleDB: \r\n  create a new DB, load a DB from file, get/set key-value pairs of different types, and more\r\n- [Lists](https://github.com/seladb/pickledb-rs/tree/master/examples/lists) which shows how to use lists in PickleDB: \r\n  create new lists, add/remove items from lists, retrieve items from lists, remove lists, and more\r\n\r\n## Changelog\r\n\r\n### Version 0.5.1\r\n\r\n- Bugfix: Add missing JSON feature gate\r\n\r\n### Version 0.5.0\r\n\r\n- Turn on/off file formats with features\r\n- `DumpUponRequest` policy no longer dumps on `Drop`\r\n- (internal) Switch CI from TravisCI to GitHub Actions\r\n\r\n### Version 0.4.1\r\n\r\n- Bump up dependencies versions to fix vulnerabilities found in few of them\r\n\r\n### Version 0.4.0\r\n\r\n- Changed all doc tests from `ignore` to `no_run` so generated docs don't contain untested warnings\r\n- Changed both instances of `lextend` to take iterators of references rather than a slice of values\r\n- Fixed bug in `load_test()`\r\n- Fixed rustfmt and clippy warnings\r\n- Added examples to `Cargo.toml` to allow them to be run via Cargo\r\n\r\n### Version 0.3.0\r\n\r\n- Added new serialization options. Now PickleDB supports [JSON](https://crates.io/crates/serde_json), [Bincode](https://crates.io/crates/bincode),\r\n  [YAML](https://crates.io/crates/serde_yaml) and [CBOR](https://crates.io/crates/serde_cbor) serializations\r\n- Added proper error handling ([Issue #3](https://github.com/seladb/pickledb-rs/issues/3))\r\n- Use `Path` and `PathBuf` instead of strings to describe DB paths\r\n- Better organization of the code\r\n\r\n### Version 0.2.0\r\n\r\n- Dump the DB to file in a crash-safe manner using a temp file (Thanks jamwt from Reddit\r\n  for the tip: https://www.reddit.com/r/rust/comments/agumun/check_out_pickledb_a_lightweight_and_simple/ee987j0)\r\n- Extend lists became easier and multiple calls to `lcreate()`, `ladd()` and `lextend()` can be chained\r\n- Added an iterator over keys and values in the DB\r\n- Added an iterator over items in a list\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseladb%2Fpickledb-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseladb%2Fpickledb-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseladb%2Fpickledb-rs/lists"}