{"id":15099841,"url":"https://github.com/diogok/lmdb-zig","last_synced_at":"2026-02-04T07:42:52.583Z","repository":{"id":250952940,"uuid":"835960335","full_name":"diogok/lmdb-zig","owner":"diogok","description":"LMDB wrapper in Zig","archived":false,"fork":false,"pushed_at":"2024-08-02T22:35:46.000Z","size":2514,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T21:53:02.876Z","etag":null,"topics":["lmdb","zig"],"latest_commit_sha":null,"homepage":"","language":"C","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/diogok.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-30T21:54:37.000Z","updated_at":"2024-08-02T22:35:48.000Z","dependencies_parsed_at":"2024-07-31T01:58:51.888Z","dependency_job_id":"1c9ae37b-fa27-4dae-927f-b844b40b171b","html_url":"https://github.com/diogok/lmdb-zig","commit_stats":null,"previous_names":["diogok/lmdb-zig"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/diogok/lmdb-zig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Flmdb-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Flmdb-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Flmdb-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Flmdb-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diogok","download_url":"https://codeload.github.com/diogok/lmdb-zig/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diogok%2Flmdb-zig/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265550480,"owners_count":23786577,"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":["lmdb","zig"],"created_at":"2024-09-25T17:28:17.345Z","updated_at":"2026-02-04T07:42:52.535Z","avatar_url":"https://github.com/diogok.png","language":"C","readme":"# LMDB for Zig\n\nThis is a wrapper for LMDB. Includes compiling LMDB from source.\n\nTested with Zig 0.13.0.\n\n## Usage\n\nCheck the full documentation at https://diogok.github.io/lmdb-zig.\n\n```zig\n// This is the directory the DB will be stored\nvar tmp = testing.tmpDir(.{});\ndefer tmp.cleanup();\n\n// We start by creating an Environment\nconst env = try Environment.init(tmp.dir, .{});\ndefer env.deinit();\n\n// Next we get a Database handler\nconst db = try env.openDatabase(null);\n\n// To write data, we begin a RW transaction\nconst tx = try env.beginTransaction(.ReadAndWrite);\n// And use the Transaction to interact with the Database\nconst dbTX = tx.withDatabase(db);\n\n// Finally, we put some data\ntry dbTX.put(\"key0\", \"value 0\");\ntry dbTX.put(\"key1\", \"value 1\");\ntry dbTX.put(\"key2\", \"value 2\");\ntry dbTX.put(\"key3\", \"value 3\");\n\n// And commit\ntry tx.commit();\n\n// Next, we start a RO transaction to read the data\nconst tx2 = try env.beginTransaction(.ReadOnly);\nconst dbTX2 = tx2.withDatabase(db);\n\n// We can read values by key\nconst value0 = dbTX1.get(\"key0\");\n\n// We can also open a Cursor to iterate over some keys\nvar cursor = try dbTX2.openCursor();\ndefer cursor.deinit();\n\n// Set the Cursor at a specific key\nvar mkv = try cursor.set(\"key1\");\nwhile (mkv) |kv| {\n\t// kv[0] is the current key\n\t// kv[1] is the current value for that key\n    mkv = try cursor.next();\n}\n\n// We still release the RO Transaction\ntry tx2.commit();\n```\n\n## License\n\nMIT\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogok%2Flmdb-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiogok%2Flmdb-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogok%2Flmdb-zig/lists"}