{"id":30067672,"url":"https://github.com/nigelhorne/db-berkeley","last_synced_at":"2025-08-08T09:04:00.846Z","repository":{"id":303807425,"uuid":"1016767431","full_name":"nigelhorne/DB-Berkeley","owner":"nigelhorne","description":"Interface to Berkeley DB","archived":false,"fork":false,"pushed_at":"2025-07-11T10:54:25.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-07T19:12:56.975Z","etag":null,"topics":["berkeley-db","cpan-module","nosql","nosql-database","perl","perl5"],"latest_commit_sha":null,"homepage":"","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nigelhorne.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,"zenodo":null}},"created_at":"2025-07-09T13:47:42.000Z","updated_at":"2025-07-11T10:54:28.000Z","dependencies_parsed_at":"2025-07-09T14:51:33.441Z","dependency_job_id":"8feb7f85-1ac8-424e-886b-7d1282c689f2","html_url":"https://github.com/nigelhorne/DB-Berkeley","commit_stats":null,"previous_names":["nigelhorne/db-berkeley"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nigelhorne/DB-Berkeley","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FDB-Berkeley","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FDB-Berkeley/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FDB-Berkeley/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FDB-Berkeley/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nigelhorne","download_url":"https://codeload.github.com/nigelhorne/DB-Berkeley/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nigelhorne%2FDB-Berkeley/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269394406,"owners_count":24409776,"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-08-08T02:00:09.200Z","response_time":72,"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":["berkeley-db","cpan-module","nosql","nosql-database","perl","perl5"],"created_at":"2025-08-08T09:02:14.304Z","updated_at":"2025-08-08T09:04:00.831Z","avatar_url":"https://github.com/nigelhorne.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nDB::Berkeley - XS-based OO Berkeley DB HASH interface\n\n# VERSION\n\nVersion 0.03\n\n# DESCRIPTION\n\nA lightweight XS wrapper around Berkeley DB using HASH format, without using tie().\nDB\\_File works, I just prefer this API.\n\n# SYNOPSIS\n\n    use DB::Berkeley;\n\n    # Open or create a Berkeley DB HASH file\n    my $db = DB::Berkeley-\u003enew(\"mydata.db\", 0, 0666);\n\n    # Store key-value pairs\n    $db-\u003eput(\"alpha\", \"A\");\n    $db-\u003eput(\"beta\",  \"B\");\n    $db-\u003eput(\"gamma\", \"G\");\n\n    # Retrieve a value\n    my $val = $db-\u003eget(\"beta\");  # \"B\"\n\n    # Check existence\n    if ($db-\u003eexists(\"alpha\")) {\n        print \"alpha is present\\n\";\n    }\n\n    # Delete a key\n    $db-\u003edelete(\"gamma\");\n\n    # Get all keys (as arrayref)\n    my $keys = $db-\u003ekeys;        # returns arrayref\n    my @sorted = sort @$keys;\n\n    # Get all values (as arrayref)\n    my $vals = $db-\u003evalues;      # returns arrayref\n\n    # Iterate using each-style interface\n    $db-\u003eiterator_reset;\n    while (my ($k, $v) = $db-\u003eeach) {\n        print \"$k =\u003e $v\\n\";\n    }\n\n    # Use low-level iteration\n    $db-\u003eiterator_reset;\n    while (defined(my $key = $db-\u003enext_key)) {\n        my $value = $db-\u003eget($key);\n        print \"$key: $value\\n\";\n    }\n\n    # Automatic cleanup when $db is destroyed\n\n# METHODS\n\n## new\n\n    my $db = DB::Berkeley-\u003enew($filename, $flags, $mode, $sync_on_put);\n\nCreates and opens a new Berkeley DB file.\nIf `$sync_on_put` is true, every `put()` will automatically call `sync()` to flush to disk.\n\n## store($key, $value)\n\nAlias for `put`. Stores a key-value pair in the database.\n\n## set($key, $value)\n\nAlias for `set`. Stores a key-value pair in the database.\n\n## fetch($key)\n\nAlias for `get`. Retrieves a value for the given key.\n\n## iterator\n\n    my $iter = $db-\u003eiterator;\n\nReturns a [DB::Berkeley::Iterator](https://metacpan.org/pod/DB%3A%3ABerkeley%3A%3AIterator) object which can be used to iterate over\nall key/value pairs in the database.\n\nThis allows you to write iterator-style loops:\n\n    my $iter = $db-\u003eiterator;\n\n    while (my $pair = $iter-\u003eeach()) {\n        my ($key, $value) = @{$pair};\n        print \"Key: $key, Value: $value\\n\";\n    }\n\nYou can reset the iterator using:\n\n    $iter-\u003eiterator_reset();\n\nNote that calling `each()` or other iteration methods directly on the `$db` object\nwill use an internal cursor that is separate from the object returned by `iterator()`.\n\nThis is especially useful for nested iteration or concurrent traversal contexts.\n\n## sync\n\n    $db-\u003esync();\n\nFlushes all pending writes to disk.\nUseful for ensuring durability between critical updates.\n\nReturns true on success.\nCroaks on error.\n\n## sync\\_on\\_put\n\n    $db-\u003esync_on_put(1);     # Enable syncing on put\n    my $flag = $db-\u003esync_on_put();  # Check current status\n\nGet or set whether `put()` operations immediately flush to disk via `sync()`.\n\n# AUTHOR\n\nNigel Horne, `\u003cnjh at nigelhorne.com\u003e`\n\n# SEE ALSO\n\n- [BerkeleyDB](https://metacpan.org/pod/BerkeleyDB)\n- [DB\\_File](https://metacpan.org/pod/DB_File)\n\n# REPOSITORY\n\n[https://github.com/nigelhorne/DB-Berkeley](https://github.com/nigelhorne/DB-Berkeley)\n\n# SUPPORT\n\nThis module is provided as-is without any warranty.\n\nPlease report any bugs or feature requests to `bug-db-berkeley at rt.cpan.org`,\nor through the web interface at\n[http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DB-Berkeley](http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DB-Berkeley).\nI will be notified, and then you'll\nautomatically be notified of progress on your bug as I make changes.\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc DB::Berkeley\n\nYou can also look for information at:\n\n- MetaCPAN\n\n    [https://metacpan.org/dist/DB-Berkeley](https://metacpan.org/dist/DB-Berkeley)\n\n- RT: CPAN's request tracker\n\n    [https://rt.cpan.org/NoAuth/Bugs.html?Dist=DB-Berkeley](https://rt.cpan.org/NoAuth/Bugs.html?Dist=DB-Berkeley)\n\n- CPAN Testers' Matrix\n\n    [http://matrix.cpantesters.org/?dist=DB-Berkeley](http://matrix.cpantesters.org/?dist=DB-Berkeley)\n\n- CPAN Testers Dependencies\n\n    [http://deps.cpantesters.org/?module=DB::Berkeley](http://deps.cpantesters.org/?module=DB::Berkeley)\n\n# LICENCE AND COPYRIGHT\n\nCopyright 2025 Nigel Horne.\n\nUsage is subject to licence terms.\n\nThe licence terms of this software are as follows:\n\n- Personal single user, single computer use: GPL2\n- All other users (including Commercial, Charity, Educational, Government)\n  must apply in writing for a licence for use from Nigel Horne at the\n  above e-mail.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Fdb-berkeley","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnigelhorne%2Fdb-berkeley","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnigelhorne%2Fdb-berkeley/lists"}