I want to announce that LMDB.jl, a wrapper for the LMDB C library, was added to the General registry again. The package existed before in pre-1.0 times, and was now brought up to date using new wrapper generators, the Artifact system etc.
LMDB provides a simple persistent key-value store, which uses memory-maps, supports all types of parallelism and is quite performant.
In the newly tagged version I also added a dictionary-like interface to LMDB.jl which should make it very simple to use the library. Here is an MWE to create and use a database at path "./mydb"
:
julia> d = LMDBDict{String, Vector{Float64}}("./mydb")
julia> d["aa"] = [1.0, 2.0, 3.0]
julia> d["ab"] = 1.0:2.0:10.0
julia> d["bb"] = [-1, -2, -3, -4]
julia> d["ab"]
5-element reinterpret(Float64, ::Vector{UInt8}):
1.0
3.0
5.0
7.0
9.0
Retrieve all entries:
julia> collect(d)
3-element Vector{Pair{String, Vector{Float64}}}:
"aa" => [1.0, 2.0, 3.0]
"ab" => [1.0, 3.0, 5.0, 7.0, 9.0]
"bb" => [-1.0, -2.0, -3.0, -4.0]
Search for keys with a certain prefix:
julia> keys(d,prefix="a")
2-element Vector{String}:
"aa"
"ab"