No description
Find a file
2025-12-12 17:35:04 +01:00
.github/workflows Update CI (#97) 2025-11-19 21:23:20 +08:00
examples Format using nph (#54) 2024-06-26 23:00:10 +08:00
rocksdb Add multiGetIter function returning iterator handle and iterators which yield slices (#101) 2025-12-12 17:35:04 +01:00
scripts Update RocksDB to v10.4.2 (#91) 2025-08-27 15:43:17 +08:00
tests Add multiGetIter function returning iterator handle and iterators which yield slices (#101) 2025-12-12 17:35:04 +01:00
triplets Fix nimble install on Fedora Linux (#78) 2025-01-03 11:26:46 +08:00
vendor Update RocksDB to v10.4.2 (#91) 2025-08-27 15:43:17 +08:00
.gitignore Fix broken CI (#35) 2024-02-13 20:59:41 +07:00
.gitmodules Build windows DLLs from vendor directory (#45) 2024-06-12 21:16:06 +08:00
config.nims Use static linking on Linux and MacOS, dynamic on Windows (#81) 2025-01-21 14:24:04 +08:00
LICENSE-APACHEv2 fix license files 2018-11-14 12:57:17 -06:00
LICENSE-MIT fix license files 2018-11-14 12:57:17 -06:00
nim.cfg Support for static linking RocksDb. (#40) 2024-03-27 14:18:21 +08:00
README.md Replace travis and appveyor badge with GHA badge in README.md (#87) 2025-06-03 09:44:29 +02:00
rocksdb.nim Add support for optimistic transaction db, write batch with index, keyMayExist and empty keys. (#63) 2024-07-08 22:18:30 +08:00
rocksdb.nimble Test both refc and orc in tests (#99) 2025-11-19 23:39:20 +08:00

Nim-RocksDb

Github action License: Apache License: MIT Stability: experimental

A Nim wrapper for Facebook's RocksDB, a persistent key-value store for Flash and RAM Storage.

Current status

Nim-RocksDb provides a wrapper for the low-level functions in the librocksdb c library.

Installation

Nim-RocksDb requires Nim and the Nimble package manager. For Windows you will need Visual Studio 2015 Update 3 or greater with the English language pack.

To get started run:

nimble install rocksdb

This will download and install the RocksDB libraries for your platform and copy them into the build/ directory of the project. On Linux and MacOS only static linking to the RocksDb libraries is supported and on Windows only dynamic linking is supported.

On Windows you may want to copy the dll into another location or set your PATH to include the build/ directory so that your application can find the dll on startup.

Compression libraries

RocksDb supports using a number of compression libraries. This library builds and only supports the following compression libraries:

  • lz4
  • zstd

On Linux and MacOS these libraries are staticly linked into the final binary along with the RocksDb static library. On Windows they are staticly linked into the RocksDb dll.

Static linking

On Linux and MacOS your Nim program will need to use the C++ linker profile because RocksDb is a C++ library. For example:

  when defined(macosx):
    switch("clang.linkerexe", "clang++")
  when defined(linux):
    switch("gcc.linkerexe", "g++")

Note that static linking is currently not supported on windows.

Usage

See simple_example

Contribution

Any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Versioning

The library generally follows the upstream RocksDb version number, adding one more number for tracking changes to the Nim wrapper itself.

License

Wrapper License

This repository is licensed and distributed under either of

or

at your option. This file may not be copied, modified, or distributed except according to those terms.

Dependency License

RocksDB is developed and maintained by Facebook Database Engineering Team. It is built on earlier work on LevelDB by Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com)

RocksDB is dual-licensed under both the GPLv2 and Apache License, Version 2.0, (LICENSE-APACHEv2 or http://www.apache.org/licenses/LICENSE-2.0). You may select, at your option, one of the above-listed licenses.