direct-rocksdb: Bindings to RocksDB.

[ bsd3, database, library ] [ Propose Tags ] [ Report a vulnerability ]

Flags

Automatic Flags
NameDescriptionDefault
system-rocksdbDisabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.1, 0.0.2, 0.0.3 (info)
Change log CHANGELOG.md
Dependencies base (>=4.10 && <5), bytestring, safe-exceptions [details]
License BSD-3-Clause
Copyright (c) 2017 Shao Cheng
Author
Maintainer Shao Cheng <astrohavoc@gmail.com>
Category Database
Home page https://github.com/TerrorJack/direct-rocksdb#readme
Bug tracker https://github.com/TerrorJack/direct-rocksdb/issues
Source repo head: git clone https://github.com/TerrorJack/direct-rocksdb
Uploaded by terrorjack at 2017-11-08T15:54:01Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 2043 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2017-11-08 [all 3 reports]

Readme for direct-rocksdb-0.0.3

[back to package description]

direct-rocksdb

CircleCI AppVeyor

Bindings to RocksDB.

Building

This package builds RocksDB in place by default. This requires:

You can use the NINJA_J environment variable to control the number of threads used by ninja, e.g. NINJA_J=2. This is a hack for building on CI, since ninja seems to fail to detect the actual number of CPU cores available.

To skip building and link with system-wide RocksDB, use the system-rocksdb Cabal flag. This is not recommended, since this package is only developed with the latest release of RocksDB.

Using

Database.RocksDB.Internals contains the raw C bindings. All functions and enum values in rocksdb/c.h are covered. The opaque types like rocksdb_t, rocksdb_options_t have corresponding Haskell types like Rocksdb, RocksdbOptions. They are nullary datatypes and are only used to mark the Ptr phantom type.

The higher-level API is being worked on. Using functions like marshalOptions, openDB, you can obtain a ForeignPtr which carries a C resource. The garbage collector can automatically invokes the ForeignPtr finalizers, and you can also use finalizeForeignPtr with something like bracket or ResourceT to ensure scoped finalizing. Also, ByteStrings are used instead of raw buffers.

Some RocksDB functions require passing in a pointer to an error message buffer for error reporting. The higher-level API will obtain the error message and throw it with a RocksDBException when present.

About Windows support

Not working at the moment (builds but crashes when built with mingw-w64 toolchain). May switch to MSVC to fix it.