SWI-Prolog interface for RocksDB

This is a SWI-Prolog pack that provides library(rocksdb), a binding to RocksDB.


Make sure you have rocksdb, including the development libraries and headers installed on your system in a location where gcc looks for them. On Debian based systems, this is done using

sudo apt-get install librocksdb-dev

Make sure to have a sufficiently recent version of SWI-Prolog. The required extensions for the C++ interface are present from version V7.3.24-32-g0ecc515. This implies the git version of swipl-devel pulled on July 11, 2016 or development version 7.3.25 or later.

If all this is in place, run

?- pack_install(rocksdb).

Manual installation

If the above fails


The wrapper provides most functionality of RocksDB. It does not provide access to the many options that can be set to configure RocksDB. These will be added on demand. Please create issues for missing functionality (or bugs).

Prolog files

demo/merge.plShow source
pack.plShow source
prolog/rocksdb.pl  -- RocksDB interfaceShow source
rocks_batch/2Perform a batch of operations on RocksDB as an atomic operation.
rocks_close/1Destroy the RocksDB handle.
rocks_delete/2Delete Key from RocksDB.
rocks_enum/3True when Value is the current value associated with Key in RocksDB.
rocks_get/3True when Value is the current value associated with Key in RocksDB.
rocks_merge/3Merge Value with the already existing value for Key.
rocks_open/3Open a RocksDB database in Directory and unify RocksDB with a handle to the opened database.Source
rocks_put/3Add Key-Value to the RocksDB database.
test/test_rocksdb.plShow source