Skip to content

Commit d583aef

Browse files
committed
Added all LMDB.Environment flags
1 parent 4e2c569 commit d583aef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lmdb.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@ const MDB_SUCCESS = Cint(0)
55
const MDB_NOTFOUND = Cint(-30798)
66

77
# Environment flags (TODO: define more)
8+
9+
const MDB_FIXEDMAP = Cuint(0x01)
810
const MDB_NOSUBDIR = Cuint(0x4000)
911
const MDB_NOSYNC = Cuint(0x10000)
1012
const MDB_RDONLY = Cuint(0x20000)
13+
const MDB_WRITEMAP = Cuint(0x80000)
14+
const MDB_MAPASYNC = Cuint(0x100000)
1115
const MDB_NOTLS = Cuint(0x200000)
16+
const MDB_NOLOCK = Cuint(0x400000)
17+
const MDB_NORDAHEAD = Cuint(0x800000)
18+
const MDB_NOMEMINIT = Cuint(0x1000000)
1219

1320
# DBI flags
1421
const MDB_CREATE = Cuint(0x40000)
@@ -240,7 +247,7 @@ end
240247

241248
const OPENED_ENVS = Dict{String,Environment}()
242249

243-
function Environment(path::String; flags::Cuint=zero(Cuint), mode::Cmode_t=0o755, maxdbs=0, mapsize=10485760, maxreaders=126, rotxnflags::Cuint=DEFAULT_ROTXN_FLAGS)
250+
function Environment(path::String; flags::Cuint=0x80000|0x100000, mode::Cmode_t=0o755, maxdbs=0, mapsize=10485760, maxreaders=126, rotxnflags::Cuint=DEFAULT_ROTXN_FLAGS)
244251
env = get(OPENED_ENVS, path, nothing)
245252
if isnothing(env)
246253
# create all directories needed to host the data

0 commit comments

Comments
 (0)