{"id":24669127,"url":"https://github.com/pymongo/gdbm_compat","last_synced_at":"2026-05-20T10:09:01.548Z","repository":{"id":57633333,"uuid":"384630398","full_name":"pymongo/gdbm_compat","owner":"pymongo","description":"FFI binding of libgdbm_compat.so database library","archived":false,"fork":false,"pushed_at":"2021-08-01T08:27:59.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T07:51:40.500Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pymongo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-10T06:43:50.000Z","updated_at":"2021-08-01T08:28:02.000Z","dependencies_parsed_at":"2022-08-31T13:21:32.494Z","dependency_job_id":null,"html_url":"https://github.com/pymongo/gdbm_compat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fgdbm_compat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fgdbm_compat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fgdbm_compat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymongo%2Fgdbm_compat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pymongo","download_url":"https://codeload.github.com/pymongo/gdbm_compat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244804942,"owners_count":20513194,"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":"2025-01-26T09:19:39.123Z","updated_at":"2026-05-20T10:09:01.502Z","avatar_url":"https://github.com/pymongo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"binding of /usr/lib/libgdbm_compat.so single file key-value database\n\n## examples\n\ncheck `examples/insert_update_query_delete.rs`\n\n### open/close dbm\n\n```rust\nlet db_filename = libc::tmpnam(std::ptr::null_mut());\nlet dbm_ptr = dbm_open(\n    db_filename,\n    libc::O_RDWR | libc::O_CREAT,\n    libc::S_IRUSR | libc::S_IWUSR,\n);\ndbm_close(dbm_ptr);\n```\n\n### insert\n\n```rust\nlet mut key = *b\"black\\0\";\nlet key_datum = datum {\n    dptr: key.as_mut_ptr().cast(),\n    dsize: key.len() as i32 - 1,\n};\nlet mut black = Color::new(0, 0, 0);\nlet value_datum = datum {\n    dptr: (\u0026mut black as *mut Color).cast(),\n    dsize: Color::SIZE as i32,\n};\ndbm_store(dbm_ptr, key_datum, value_datum, StoreMode::DBM_INSERT);\n```\n\n### query\n\n```rust\nlet value_datum = dbm_fetch(dbm_ptr, key_datum);\nif !value_datum.dptr.is_null() {\n    let mut color = std::mem::zeroed::\u003cColor\u003e();\n    std::ptr::copy(\n        value_datum.dptr.cast(),\n        \u0026mut color as *mut Color,\n        value_datum.dsize as usize,\n    );\n    assert_eq!(color, black);\n}\n```\n\n### delete\n\n```rust\nif dbm_delete(dbm_ptr, key_datum) == 0 {\n    println!(\"delete success\");\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymongo%2Fgdbm_compat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpymongo%2Fgdbm_compat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymongo%2Fgdbm_compat/lists"}