Crates.io | rocks |
lib.rs | rocks |
version | 0.1.10 |
source | src |
created_at | 2017-05-24 16:58:23.646046 |
updated_at | 2021-01-16 10:13:25.006715 |
description | RocksDB bindings for Rust. |
homepage | https://github.com/bh1xuw/rust-rocks |
repository | https://github.com/bh1xuw/rust-rocks |
max_upload_size | |
id | 15822 |
size | 531,177 |
Another RocksDB binding for Rust. Documentation
Make RocksDB really rocks!
vcpkg
rocksdb5.8
branch), both x86_64 and aarch64(RPi 3)rocksdb5.17
branch)Dynamicly link RocksDB:
[dependencies]
rocks = "0.1"
Static link against RocksDB(with snappy enabled by default):
[dependencies.rocks]
version = "0.1"
default-features = false
features = ["static-link"]
With all static features(all compression types):
[dependencies.rocks]
version = "0.1"
default-features = false
features = ["full"]
Feel free to refer Travic-CI, AppVeyor and Github Actions configuration files.
$ git submodule update --init --recursive
$ cargo test --features static-link -- --test-threads 1
(This will build with snappy as the only compression supported)
$ cargo test --features full -- --test-threads 1
(This will build with all compression supported)
For macOS(with RocksDB installed via brew):
$ brew install rocksdb
$ cargo test -- --nocapture --test-threads 1
For Linux:
(install rocksdb via package manager or make & install)
$ sudo apt install lld
(NOTE: gcc-ld can't handle circular references while linking.)
(for more, refer the last section of README)
$ RUSTFLAGS="-C link-arg=-fuse-ld=lld" cargo test -- --test-threads 1
Use environment variables if rocksdb is installed to non-default directory:
LD_LIBRARY_PATH=/usr/local/lib LIBRARY_PATH=/usr/local/lib CXXFLAGS=-I/usr/local/include
RocksDB changes its API often, so rust-rocks
use different branch to support Ubuntu LTS.
> sudo apt install librocksdb-dev libsnappy-dev
You also need lld
form official source or http://apt.llvm.org/
.
Branches:
You need VS 2017 or VS 2019, and install RocksDB via vcpkg.
Feel free to Open a New Issue.
$ cargo run --example it-works
RocksDB: 6.7.3
Compression Supported:
- NoCompression
- SnappyCompression
- ZlibCompression
- BZip2Compression
- LZ4Compression
- LZ4HCCompression
- ZSTD
- ZSTDNotFinalCompression
Bindgen:
$ cd rocks-sys
$ PATH="/usr/local/opt/llvm/bin:$PATH" make
(this will regenerate the bindgen c.rs)
--start-group
and --end-group
lld
as linker, RUSTFLAGS="-C link-arg=-fuse-ld=lld"
lazy_static
and wrapped in trait objects
ColumnFamilyOptions::comparator
: const Comparator*
ColumnFamilyOptions::compaction_filter
: const CompactionFilter*
Ref: https://github.com/bh1xuw/rust-rocks/issues/15
for
-traverse: That's OK