Skip to content

Releases: JuliaDatabases/LMDB.jl

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 08 Jul 17:21
97defd1

LMDB v3.0.0

Diff since v2.0.0

Breaking changes: Upgrade to LMDB 1.0, whose on-disk format is incompatible with LMDB 0.9

Merged pull requests:

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 22 May 15:39
4a1137d

LMDB v2.0.0

Diff since v1.0.0

Revival of LMDB.jl, fixing many issues and adding a new mid-level API for more direct access to LMDB's features (i.e., where the Dict doesn't suffice, but without having to drop down to the C API).

Breaking changes:

  • The minimum Julia version is now 1.10.
  • The factory functions create(), environment(path), start(env), open(env, path), open(txn), open(txn, dbi) have been replaced by constructors: LMDB.Environment(path; mapsize, maxreaders, maxdbs, flags, mode), LMDB.Transaction(env; flags, parent), LMDB.Database(txn, name; flags), LMDB.Cursor(txn, dbi).
  • The DBI struct was renamed to Database.
  • Only LMDBDict and LMDBError are exported. Everything else moved to @public, so the wrapper types and operations are reached as LMDB.Environment, LMDB.Transaction, LMDB.Database, LMDB.Cursor, LMDB.set!, LMDB.sync, LMDB.info, LMDB.seek!, etc.
  • The whole 1.x cursor iteration surface is gone: LMDBIterator, ReturnKeys, ReturnValues, ReturnBoth, ReturnValueSize, DirectoryLister, Base.iterate(cur, K, V), keys(cur, T; prefix), values(cur, T; prefix), and get(cur, key, T, op::MDB_cursor_op). Replaced by either iteration over LMDBDict (which is now <: AbstractDict) or, at the cursor level, explicit positioning with LMDB.seek! / LMDB.seek_range! / LMDB.next! / LMDB.prev! / the _dup/_nodup variants plus LMDB.key(cur, K) / LMDB.value(cur, V) / LMDB.item(cur, K, V). For bulk traversal, use LMDB.walk(f, cur; from).
  • tryget(txn, dbi, key, T) is replaced by LMDB.get(txn, dbi, key, T, nothing), which is the canonical Base.get(d, k, default) shape. The throwing form LMDB.get(txn, dbi, key, T) and the new default-form LMDB.get(txn, dbi, key, T, default) are the two read primitives.
  • The custom typed-decode extension point _mbd_unpack(T, ::MDB_val) is gone. Override Base.read(io::IO, ::Type{T}) instead.
  • Base.keys(d::LMDBDict; prefix) and Base.values(d::LMDBDict; prefix) no longer return a collected Vector; they now return the standard KeySet / ValueIterator views from AbstractDict. For prefix-scoped collected results, use LMDB.scan_keys(d; prefix), LMDB.scan_values(d; prefix), or LMDB.scan(d; prefix) for pairs.
  • Base.empty(d::LMDBDict) and Base.copy(d::LMDBDict) now throw ArgumentError: an LMDBDict needs an on-disk directory, so there's no path-less zero-argument form. Use Dict(d) for an in-memory snapshot or Base.copy(d.env, path) for an on-disk clone.
  • info(env) previously returned an MDB_envinfo C struct with me_-prefixed fields. It now returns a NamedTuple with mapaddr, mapsize, last_pgno, last_txnid, maxreaders, numreaders.
  • put!(txn, dbi, key, val) returns nothing instead of a Cint status. delete!(txn, dbi, key) returns Bool (true if removed, false if MDB_NOTFOUND) instead of throwing on missing. The optional val argument no longer has a C_NULL default; use delete!(txn, dbi, key, val) for DUPSORT-specific dup removal.
  • LMDB.LibLMDB submodule is gone. C bindings live directly in LMDB now, reachable as LMDB.mdb_env_open, LMDB.MDB_val, LMDB.MDB_NOTFOUND, etc.
  • env[:Unknown] and env[:Unknown] = v now throw ArgumentError instead of warning and returning a meaningless zero.

For an example, what looked like this in 1.0:

env = create()
env[:MapSize] = 1 << 30
open(env, "/tmp/db")
start(env) do txn
    dbi = open(txn)
    put!(txn, dbi, "k", "v")
    v = tryget(txn, dbi, "k", String)   # → Union{String,Nothing}
end
close(env)

... now looks like:

LMDB.Environment("/tmp/db"; mapsize = 1 << 30) do env
    LMDB.Transaction(env) do txn
        LMDB.Database(txn) do dbi
            put!(txn, dbi, "k", "v")
            v = LMDB.get(txn, dbi, "k", String, nothing)
        end
    end
end

Merged pull requests:

Closed issues:

  • Setting flags (#24)
  • Release v1.0? (#35)
  • uint32 limits mapsize (#38)
  • apple silicon support (#39)
  • Sketchy useage of unsafe_wrap/unsafe_string (#41)
  • LMDBDict producing random data (#46)
  • Move to JuliaDatabases org (#47)
  • PSA: registry is trying to reach you (#48)

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 05 Sep 08:51
bdc2df6

LMDB v1.0.0

Diff since v0.2.1

Closed issues:

  • Source file URLS in documentation seem to be local to the build machine (#21)
  • type piracy in convert causes ambiguity errors (#29)
  • Warning fails to show (#30)

Merged pull requests:

  • Don't check the Manifest.toml file into source control (#31) (@DilumAluthge)
  • Add the get!(d::LMDBDict, key, default), get(f::Function, d::LMDBDict, key), and get!(f::Function, d::LMDBDict, key) methods (#32) (@DilumAluthge)
  • Change all occurences of warn(...) to @warn(...) (#33) (@DilumAluthge)
  • Don't extend Base.convert; instead, define a separate mbd_unpack function (#34) (@DilumAluthge)
  • Update Project.toml (#36) (@meggart)

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 13 Dec 16:56
2a3b9b0

LMDB v0.2.1

Diff since v0.2.0

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 11 Dec 00:42

LMDB v0.2.0

Closed issues:

  • Segfaults (#1)
  • Fails to build on OS X (#2)
  • add project to Projects using Docile / Lexicon (#3)
  • Problems building LMDB (#4)
  • Parallel access? (#5)
  • Get rid of C wrapper code (#6)
  • Wrap cursor in an interator (#7)
  • pointer to invalid memory in MDBValue? (#12)
  • unable to store types other than Number, String, and Array (#13)
  • tag a release? (#17)
  • Failing to build on Gitlab's CI runner (#20)
  • Info about upcoming removal of packages in the General registry (#22)
  • Julia can't find library (#25)

Merged pull requests: