Nim wrapper for RocksDB, a persistent key-value store for Flash and RAM Storage.
Go to file
web3-developer 03313d8068
Auto close feature to improve memory management of option types. (#57)
* Revert some changes from prior PR https://github.com/status-im/nim-rocksdb/pull/48 which enable memory leak of options when not cleaned up manually.

* Clean up, add more tests and use correct free function for listColumnFamilies.

* Close opt types when opening database fails.

* Add autoClose flag to each opt type.

* Finish autoClose changes to prevent memory leaks.
2024-06-28 10:04:37 +08:00
.github/workflows Update API to support passing in ColFamilyHandleRef instead of column family string. (#52) 2024-06-27 01:31:39 +08:00
examples Format using nph (#54) 2024-06-26 23:00:10 +08:00
rocksdb Auto close feature to improve memory management of option types. (#57) 2024-06-28 10:04:37 +08:00
scripts Update RocksDb header file and automate regeneration of wrapper. 2024-06-21 12:08:16 +08:00
tests Auto close feature to improve memory management of option types. (#57) 2024-06-28 10:04:37 +08:00
triplets Build windows DLLs from vendor directory (#45) 2024-06-12 21:16:06 +08:00
vendor Build windows DLLs from vendor directory (#45) 2024-06-12 21:16:06 +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
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
README.md Build windows DLLs from vendor directory (#45) 2024-06-12 21:16:06 +08:00
config.nims Format using nph (#54) 2024-06-26 23:00:10 +08:00
nim.cfg Support for static linking RocksDb. (#40) 2024-03-27 14:18:21 +08:00
rocksdb.nim Format using nph (#54) 2024-06-26 23:00:10 +08:00
rocksdb.nimble Update API to support passing in ColFamilyHandleRef instead of column family string. (#52) 2024-06-27 01:31:39 +08:00

README.md

Nim-RocksDB

Build Status (Travis) Windows build status (Appveyor) 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.

Requirements

A RocksDB installation that provides librocksdb.so. This means that on Debian, and possibly on other Linux distros, you need "librocksdb-dev", not just a versioned "librocksdbX.Y" package that only provides librocksdb.so.X.Y.Z.

Usage

See simple_example

Static linking

To statically link librocksdb, you would do something like:

nim c -d:rocksdb_static_linking --threads:on your_program.nim

See the config.nims file which contains the static linking configuration which is switched on with the rocksdb_static_linking flag. Note that static linking is currently not supported on windows.

Building Windows DLLs

Prerequisites:

  • Windows 7 or newer
  • Git
  • Visual Studio 2015 Update 3 or greater with the English language pack

To build RocksDB for Windows, run the following:

.\scripts\build_dlls_windows.bat

After the build completes the built RocksDB DLLs will be located in the build directory.

Contribution

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

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.