Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drup/ocaml-lmdb
Ocaml bindings for lmdb.
https://github.com/drup/ocaml-lmdb
ctypes database lmdb ocaml
Last synced: 2 months ago
JSON representation
Ocaml bindings for lmdb.
- Host: GitHub
- URL: https://github.com/drup/ocaml-lmdb
- Owner: Drup
- License: mit
- Created: 2014-06-27T20:54:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-07-24T18:37:01.000Z (over 1 year ago)
- Last Synced: 2024-10-13T21:34:33.533Z (3 months ago)
- Topics: ctypes, database, lmdb, ocaml
- Language: OCaml
- Homepage: https://drup.github.io/ocaml-lmdb/dev/
- Size: 381 KB
- Stars: 48
- Watchers: 6
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# OCaml-lmdb [![Build Status](https://travis-ci.org/Drup/ocaml-lmdb.svg?branch=master)](https://travis-ci.org/Drup/ocaml-lmdb) [![docs](https://img.shields.io/badge/doc-online-blue.svg)][doc]
The [LMDB][] database is a fast in-file database that supports ACID transactions.
These bindings expose a typesafe yet low-overhead API. Both transactions and cursors are available.
Database implementations are specialized both by keys and values.
Two module are predefined: `Lmdb.Db` (string keys and string values) and `Lmdb.IntDb` (int keys and string values).
New implementation (which can use special LMDB features such as multi-values) can be added via a functorial interface.Please consult the [documentation][doc] and a [simple example](tests/simple_db.ml).
```ocaml
let open Lmdb in
let env = Env.(create Rw ~flags:Flags.no_subdir ~max_maps:1) "mydb" in
let map = Map.create Nodup ~key:Conv.string ~value:Conv.string
~name:"Camelidae" env in
Map.add map "Bactrian camel" "Elegant and beautiful animal with two humps."
```[lmdb]: http://symas.com/mdb/#overview
[doc]: https://drup.github.io/ocaml-lmdb/dev/lmdb/Lmdb/index.html