{"id":22822597,"url":"https://github.com/manighazaee/mu_db","last_synced_at":"2025-08-01T10:04:51.788Z","repository":{"id":229352122,"uuid":"740675488","full_name":"ManiGhazaee/mu_db","owner":"ManiGhazaee","description":"A simple and lightweight key-value based database","archived":false,"fork":false,"pushed_at":"2024-03-23T19:17:30.000Z","size":2084,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-30T09:50:31.889Z","etag":null,"topics":["database","rust","storage"],"latest_commit_sha":null,"homepage":"https://docs.rs/mu_db/latest/mu_db/","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/ManiGhazaee.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":"2024-01-08T20:45:03.000Z","updated_at":"2024-04-12T22:40:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"aefbe4aa-198d-429c-8821-89c76d9d7ee7","html_url":"https://github.com/ManiGhazaee/mu_db","commit_stats":null,"previous_names":["manighazaee/mu_db"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ManiGhazaee/mu_db","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiGhazaee%2Fmu_db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiGhazaee%2Fmu_db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiGhazaee%2Fmu_db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiGhazaee%2Fmu_db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ManiGhazaee","download_url":"https://codeload.github.com/ManiGhazaee/mu_db/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ManiGhazaee%2Fmu_db/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268049061,"owners_count":24187235,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":["database","rust","storage"],"created_at":"2024-12-12T16:12:29.714Z","updated_at":"2025-08-01T10:04:51.715Z","avatar_url":"https://github.com/ManiGhazaee.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":" # muDB \r\n\r\n - DataBase is a simple, lightweight database that provides basic database functionalities, and can be created using the new function, which takes a path to the database file as an argument.\r\n - The database supports basic operations such as inserting key-value pairs, retrieving values, removing entries, and clearing all data.\r\n - It also offers advanced features like direct read/write operations at specified positions, checking if the database or buffer is empty, and optimizing the database file by removing unused space.\r\n\r\n ## Example\r\n\r\n ```rust\r\n let mut db = mu_db::DataBase::new(\"./test.db\");\r\n // This will generate ./test.db and ./index_test.db if they don't exist.\r\n\r\n db.insert(\"key\", \"before_value\");\r\n db.insert(\"key\", \"after_value\");\r\n\r\n let value = db.get(\"key\");\r\n assert_eq!(value, Some(\"after_value\".to_string()));\r\n\r\n db.remove(\"key\");\r\n\r\n assert_eq!(db.get(\"key\"), None);\r\n assert!(db.is_empty()); // index is empty\r\n assert!(!db.is_buf_empty()); // db is not empty\r\n assert_eq!(db.buf_len(), 12); // db: `after_valuee`\r\n\r\n db.shrink(); // remove unused space\r\n assert!(db.is_buf_empty());\r\n\r\n db.write_at(5, \"world\").unwrap(); // write to db file directly without syncing index\r\n let data = db.read_at(5, 5).unwrap(); // read db file directly\r\n\r\n assert_eq!(data, \"world\".to_string());\r\n\r\n db.clear_all().unwrap(); // clear everything (index and db)\r\n\r\n assert!(db.is_empty());\r\n assert!(db.is_buf_empty());\r\n ```\r\n\r\n Please note that the mu_db is a simple, lightweight database and does not support complex database operations like transactions, joins, etc. It is best suited for simple key-value storage needs.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanighazaee%2Fmu_db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanighazaee%2Fmu_db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanighazaee%2Fmu_db/lists"}