diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-05-09 01:10:45 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-05-09 01:12:39 +0000 |
| commit | 06faa066d11e2e76ffcf0207f34ea8c6e66a1a76 (patch) | |
| tree | e70ece0aaa523610ea2f1c26cb42c3516ac9d1d8 /lib/management/storage | |
| parent | 46782ba284f1421c866952a2de850c3d05113692 (diff) | |
| download | Sakura-06faa066d11e2e76ffcf0207f34ea8c6e66a1a76.tar.gz Sakura-06faa066d11e2e76ffcf0207f34ea8c6e66a1a76.zip | |
We're not using multiple LMDB databases, so avoid passing a name
Diffstat (limited to 'lib/management/storage')
| -rw-r--r-- | lib/management/storage/lmdb.ml | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/management/storage/lmdb.ml b/lib/management/storage/lmdb.ml index 0aa9905..e1c4307 100644 --- a/lib/management/storage/lmdb.ml +++ b/lib/management/storage/lmdb.ml @@ -6,7 +6,7 @@ module B : Physical.BACKEND with type error = string = struct let mdb_notfound = -30798 end - type configuration = { path : string; name : string } + type configuration = { path : string } type connection = { env : mdb_env structure ptr; dbi : mdb_dbi } type error = string (* int *) (* FIXME *) @@ -21,11 +21,7 @@ module B : Physical.BACKEND with type error = string = struct |> Option.to_result ~none:"Missing key: path" |> fmap (Configuration.atom_of_sexp) in - let* name = Utilities.StringMap.find_opt "name" keys - |> Option.to_result ~none:"Missing key: name" - |> fmap (Configuration.atom_of_sexp) - in - Ok { path; name } + Ok { path } let current_tx () = Effect.perform Current let current_tx' () = try current_tx () with Effect.Unhandled Current -> (from_voidp mdb_txn null) @@ -55,11 +51,12 @@ module B : Physical.BACKEND with type error = string = struct let abort _ = Effect.perform Rollback - let connect { path; name } = + let connect { path; _ } = begin let open Utilities.Result in let* env = mdb_env_create' () in - match mdb_env_open env path (Unsigned.UInt.of_int 0) PosixTypes.Mode.zero with + (* TODO: make the POSIX mode a config parameter *) + match mdb_env_open env path Unsigned.UInt.zero (PosixTypes.Mode.of_int 420) with | Error x -> mdb_env_close env; Error x @@ -67,7 +64,7 @@ module B : Physical.BACKEND with type error = string = struct Result.bind (with_transaction' env (fun () -> - let* dbi = mdb_dbi_open' (current_tx ()) name (Unsigned.UInt.of_int 0) in + let* dbi = mdb_dbi_open' (current_tx ()) Unsigned.UInt.zero in Ok { env; dbi })) Option.get end |
