{"id":13714234,"url":"https://github.com/bmatsuo/lmdb-go","last_synced_at":"2026-02-05T17:09:11.093Z","repository":{"id":28035905,"uuid":"31531429","full_name":"bmatsuo/lmdb-go","owner":"bmatsuo","description":"Bindings for the LMDB C library","archived":false,"fork":false,"pushed_at":"2022-07-09T09:45:06.000Z","size":824,"stargazers_count":162,"open_issues_count":24,"forks_count":62,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-07T01:40:40.932Z","etag":null,"topics":["cgo","database","go","lmdb"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmatsuo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-02T08:58:11.000Z","updated_at":"2025-04-18T07:29:05.000Z","dependencies_parsed_at":"2022-09-04T09:11:38.320Z","dependency_job_id":null,"html_url":"https://github.com/bmatsuo/lmdb-go","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/bmatsuo/lmdb-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatsuo%2Flmdb-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatsuo%2Flmdb-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatsuo%2Flmdb-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatsuo%2Flmdb-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmatsuo","download_url":"https://codeload.github.com/bmatsuo/lmdb-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatsuo%2Flmdb-go/sbom","scorecard":{"id":245357,"data":{"date":"2025-08-11","repo":{"name":"github.com/bmatsuo/lmdb-go","commit":"a14b5a390eff52e52a20eceb3020038b3d291432"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'releases/v1.7.0'","Warn: branch protection not enabled for branch 'releases/v1.6.0'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T07:31:16.336Z","repository_id":28035905,"created_at":"2025-08-17T07:31:16.337Z","updated_at":"2025-08-17T07:31:16.337Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29126233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T14:05:12.718Z","status":"ssl_error","status_checked_at":"2026-02-05T14:03:53.078Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cgo","database","go","lmdb"],"created_at":"2024-08-02T23:01:55.304Z","updated_at":"2026-02-05T17:09:11.077Z","avatar_url":"https://github.com/bmatsuo.png","language":"C","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"#lmdb-go [![releases/v1.8.0](https://img.shields.io/badge/release-v1.8.0-375eab.svg)](releases) [![C/v0.9.19](https://img.shields.io/badge/C-v0.9.19-555555.svg)](https://github.com/LMDB/lmdb/blob/mdb.RE/0.9/libraries/liblmdb/CHANGES) [![Build Status](https://travis-ci.org/bmatsuo/lmdb-go.svg?branch=master)](https://travis-ci.org/bmatsuo/lmdb-go)\n\nGo bindings to the OpenLDAP Lightning Memory-Mapped Database (LMDB).\n\n## Packages\n\nFunctionality is logically divided into several packages.  Applications will\nusually need to import **lmdb** but may import other packages on an as needed\nbasis.\n\nPackages in the `exp/` directory are not stable and may change without warning.\nThat said, they are generally usable if application dependencies are managed\nand pinned by tag/commit.\n\nDevelopers concerned with package stability should consult the documentation.\n\n####lmdb [![GoDoc](https://godoc.org/github.com/bmatsuo/lmdb-go/lmdb?status.svg)](https://godoc.org/github.com/bmatsuo/lmdb-go/lmdb) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](#user-content-versioning-and-stability)\n\n```go\nimport \"github.com/bmatsuo/lmdb-go/lmdb\"\n```\n\nCore bindings allowing low-level access to LMDB.\n\n####lmdbscan [![GoDoc](https://godoc.org/github.com/bmatsuo/lmdb-go/lmdbscan?status.svg)](https://godoc.org/github.com/bmatsuo/lmdb-go/lmdbscan) [![stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](#user-content-versioning-and-stability)\n\n```go\nimport \"github.com/bmatsuo/lmdb-go/lmdbscan\"\n```\n\nA utility package for scanning database ranges. The API is inspired by\n[bufio.Scanner](https://godoc.org/bufio#Scanner) and the python cursor\n[implementation](https://lmdb.readthedocs.org/en/release/#cursor-class).\n\n####exp/lmdbpool [![GoDoc](https://godoc.org/github.com/bmatsuo/lmdb-go/exp/lmdbpool?status.svg)](https://godoc.org/github.com/bmatsuo/lmdb-go/exp/lmdbpool) [![experimental](https://img.shields.io/badge/stability-experimental-red.svg)](#user-content-versioning-and-stability)\n\n\n```go\nimport \"github.com/bmatsuo/lmdb-go/exp/lmdbpool\"\n```\n\nA utility package which facilitates reuse of lmdb.Txn objects using a\nsync.Pool.  Naively storing lmdb.Txn objects in sync.Pool can be troublesome.\nAnd the lmdbpool.TxnPool type has been defined as a complete pooling solution\nand as reference for applications attempting to write their own pooling\nimplementation.\n\nThe lmdbpool package is relatively new.  But it has a lot of potential utility.\nAnd once the lmdbpool API has been ironed out, and the implementation hardened\nthrough use by real applications it can be integrated directly into the lmdb\npackage for more transparent integration.  Please test this package and provide\nfeedback to speed this process up.\n\n####exp/lmdbsync [![GoDoc](https://godoc.org/github.com/bmatsuo/lmdb-go/exp/lmdbsync?status.svg)](https://godoc.org/github.com/bmatsuo/lmdb-go/exp/lmdbsync) [![experimental](https://img.shields.io/badge/stability-experimental-red.svg)](#user-content-versioning-and-stability)\n\n\n```go\nimport \"github.com/bmatsuo/lmdb-go/exp/lmdbsync\"\n```\n\nAn experimental utility package that provides synchronization necessary to\nchange an environment's map size after initialization.  The package provides\nerror handlers to automatically manage database size and retry failed\ntransactions.\n\nThe **lmdbsync** package is usable but the implementation of Handlers are\nunstable and may change in incompatible ways without notice.  The use cases of\ndynamic map sizes and multiprocessing are niche and the package requires much\nmore development driven by practical feedback before the Handler API and the\nprovided implementations can be considered stable.\n\n## Key Features\n\n###Idiomatic API\n\nAPI inspired by [BoltDB](https://github.com/boltdb/bolt) with automatic\ncommit/rollback of transactions.  The goal of lmdb-go is to provide idiomatic\ndatabase interactions without compromising the flexibility of the C API.\n\n**NOTE:** While the lmdb package tries hard to make LMDB as easy to use as\npossible there are compromises, gotchas, and caveats that application\ndevelopers must be aware of when relying on LMDB to store their data.  All\nusers are encouraged to fully read the\n[documentation](https://godoc.org/github.com/bmatsuo/lmdb-go/lmdb) so they are\naware of these caveats.\n\nWhere the lmdb package and its implementation decisions do not meet the needs\nof application developers in terms of safety or operational use the lmdbsync\npackage has been designed to wrap lmdb and safely fill in additional\nfunctionality.  Consult the\n[documentation](https://godoc.org/github.com/bmatsuo/lmdb-go/exp/lmdbsync) for\nmore information about the lmdbsync package.\n\n###API coverage\n\nThe lmdb-go project aims for complete coverage of the LMDB C API (within\nreason).  Some notable features and optimizations that are supported:\n\n- Idiomatic subtransactions (\"sub-updates\") that allow the batching of updates.\n\n- Batch IO on databases utilizing the `MDB_DUPSORT` and `MDB_DUPFIXED` flags.\n\n- Reserved writes than can save in memory copies converting/buffering into\n  `[]byte`.\n\nFor tracking purposes a list of unsupported features is kept in an\n[issue](https://github.com/bmatsuo/lmdb-go/issues/1).\n\n###Zero-copy reads\n\nApplications with high performance requirements can opt-in to fast, zero-copy\nreads at the cost of runtime safety.  Zero-copy behavior is specified at the\ntransaction level to reduce instrumentation overhead.\n\n```\nerr := lmdb.View(func(txn *lmdb.Txn) error {\n    // RawRead enables zero-copy behavior with some serious caveats.\n    // Read the documentation carefully before using.\n    txn.RawRead = true\n\n    val, err := txn.Get(dbi, []byte(\"largevalue\"), 0)\n    // ...\n})\n```\n\n###Documentation\n\nComprehensive documentation and examples are provided to demonstrate safe usage\nof lmdb.  In addition to [godoc](https://godoc.org/github.com/bmatsuo/lmdb-go)\ndocumentation, implementations of the standand LMDB commands (`mdb_stat`, etc)\ncan be found in the [cmd/](cmd/) directory and some simple experimental\ncommands can be found in the [exp/cmd/](exp/cmd) directory.  Aside from\nproviding minor utility these programs are provided as examples of lmdb in\npractice.\n\n##LMDB compared to BoltDB\n\nBoltDB is a quality database with a design similar to LMDB.  Both store\nkey-value data in a file and provide ACID transactions.  So there are often\nquestions of why to use one database or the other.\n\n###Advantages of BoltDB\n\n- Nested databases allow for hierarchical data organization.\n\n- Far more databases can be accessed concurrently.\n\n- Operating systems that do not support sparse files do not use up excessive\n  space due to a large pre-allocation of file space.  The exp/lmdbsync package\n  is intended to resolve this problem with LMDB but it is not ready.\n\n- As a pure Go package bolt can be easily cross-compiled using the `go`\n  toolchain and `GOOS`/`GOARCH` variables.\n\n- Its simpler design and implementation in pure Go mean it is free of many\n  caveats and gotchas which are present using the lmdb package.  For more\n  information about caveats with the lmdb package, consult its\n  [documentation](https://godoc.org/github.com/bmatsuo/lmdb-go/lmdb).\n\n###Advantages of LMDB\n\n- Keys can contain multiple values using the DupSort flag.\n\n- Updates can have sub-updates for atomic batching of changes.\n\n- Databases typically remain open for the application lifetime.  This limits\n  the number of concurrently accessible databases.  But, this minimizes the\n  overhead of database accesses and typically produces cleaner code than\n  an equivalent BoltDB implementation.\n\n- Significantly faster than BoltDB.  The raw speed of LMDB easily surpasses\n  BoltDB.  Additionally, LMDB provides optimizations ranging from safe,\n  feature-specific optimizations to generally unsafe, extremely situational\n  ones.  Applications are free to enable any optimizations that fit their data,\n  access, and reliability models.\n\n- LMDB allows multiple applications to access a database simultaneously.\n  Updates from concurrent processes are synchronized using a database lock\n  file.\n\n- As a C library, applications in any language can interact with LMDB\n  databases.  Mission critical Go applications can use a database while Python\n  scripts perform analysis on the side.\n\n##Build\n\nThere is no dependency on shared libraries.  So most users can simply install\nusing `go get`.\n\n`go get github.com/bmatsuo/lmdb-go/lmdb`\n\nOn FreeBSD 10, you must explicitly set `CC` (otherwise it will fail with a\ncryptic error), for example:\n\n    CC=clang go test -v ./...\n\nBuilding commands and running tests can be done with `go` or with `make`\n\n    make bin\n    make test\n    make check\n    make all\n\nOn Linux, you can specify the `pwritev` build tag to reduce the number of syscalls\nrequired when committing a transaction. In your own package you can then do\n\n    go build -tags pwritev .\n\nto enable the optimisation.\n\n##Documentation\n\n###Go doc\n\nThe `go doc` documentation available on\n[godoc.org](https://godoc.org/github.com/bmatsuo/lmdb-go) is the primary source\nof developer documentation for lmdb-go.  It provides an overview of the API\nwith a lot of usage examples.  Where necessary the documentation points out\ndifferences between the semantics of methods and their C counterparts.\n\n###LMDB\n\nThe LMDB [homepage](http://symas.com/mdb/) and mailing list\n([archives](http://www.openldap.org/lists/openldap-technical/)) are the\nofficial source of documentation regarding low-level LMDB operation and\ninternals.\n\nAlong with an API reference LMDB provides a high-level\n[summary](http://symas.com/mdb/doc/starting.html) of the library.  While\nlmdb-go abstracts many of the thread and transaction details by default the\nrest of the guide is still useful to compare with `go doc`.\n\n###Versioning and Stability\n\nThe lmdb-go project makes regular releases with IDs `X.Y.Z`.  All packages\noutside of the `exp/` directory are considered stable and adhere to the\nguidelines of [semantic versioning](http://semver.org/).\n\nExperimental packages (those packages in `exp/`) are not required to adhere to\nsemantic versioning.  However packages specifically declared to merely be\n\"unstable\" can be relied on more for long term use with less concern.\n\nThe API of an unstable package may change in subtle ways between minor release\nversions.  But deprecations will be indicated at least one release in advance\nand all functionality will remain available through some method.\n\n##License\n\nExcept where otherwise noted files in the lmdb-go project are licensed under\nthe BSD 3-clause open source license.\n\nThe LMDB C source is licensed under the OpenLDAP Public License.\n\n##Links\n\n####[github.com/bmatsuo/raft-mdb](https://github.com/bmatsuo/raft-mdb) ([godoc](https://godoc.org/github.com/bmatsuo/raft-mdb))\n\nAn experimental backend for\n[github.com/hashicorp/raft](https://github.com/hashicorp/raft) forked from\n[github.com/hashicorp/raft-mdb](https://github.com/hashicorp/raft-mdb).\n\n####[github.com/bmatsuo/cayley/graph/lmdb](https://github.com/bmatsuo/cayley/tree/master/graph/lmdb) ([godoc](https://godoc.org/github.com/bmatsuo/cayley/graph/lmdb))\n\nExperimental backend quad-store for\n[github.com/google/cayley](https://github.com/google/cayley) based off of the\nBoltDB\n[implementation](https://github.com/google/cayley/tree/master/graph/bolt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmatsuo%2Flmdb-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmatsuo%2Flmdb-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmatsuo%2Flmdb-go/lists"}