- Notifications
You must be signed in to change notification settings - Fork803
rust-rocksdb/rust-rocksdb
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- Clang and LLVM
Feedback and pull requests are welcome! If a particular feature of RocksDB isimportant to you, please let me know by opening an issue, and I'llprioritize it.
This binding is statically linked with a specific version of RocksDB. If youwant to build it yourself, make sure you've also cloned the RocksDB andcompression submodules:
git submodule update --init --recursive
By default, support forSnappy,LZ4,Zstd,Zlib, andBzip2 compressionis enabled through crate features. If support for all of these compressionalgorithms is not needed, default features can be disabled and specificcompression algorithms can be enabled. For example, to enable only LZ4compression support, make these changes to your Cargo.toml:
[dependencies.rocksdb]default-features =falsefeatures = ["lz4"]
RocksDB allows column families to be created and droppedfrom multiple threads concurrently, but this crate doesn't allow it by defaultfor compatibility. If you need to modify column families concurrently, enablethe crate featuremulti-threaded-cf
, which makes this binding'sdata structures useRwLock
by default. Alternatively, you can directly createDBWithThreadMode<MultiThreaded>
without enabling the crate feature.
The featuremt_static
will request the library to be built with/MTflag, which results in library using the static version of the run-time library.This can be useful in case there's a conflict in the dependency tree between differentrun-time versions.
The featurebindgen-runtime
will enable theruntime
feature of bindgen, which dynamicallylinks to libclang. This is suitable for most platforms, and is enabled by default.
The featurebindgen-static
will enable thestatic
feature of bindgen, which staticallylinks to libclang. This is suitable for musllinux platforms, such as Alpine linux.To build on Alpine linux for example, make these changes to your Cargo.toml:
[dependencies.rocksdb]default-features =falsefeatures = ["bindgen-static","snappy","lz4","zstd","zlib","bzip2"]
Notice thatruntime
andstatic
features are mutually exclusive, and won't compile if both are enabled.
Enable thelto
feature to enable link-time optimization. It will compile rocksdb with-flto
flag. This feature is disabled by default.
Important
You must use clang asCC
. Eg.CC=/usr/bin/clang CXX=/usr/bin/clang++
. Clang llvm version must be the same as the one used by rust compiler.On the rust side you should useRUSTFLAGS="-Clinker-plugin-lto -Clinker=clang -Clink-arg=-fuse-ld=lld"
.
Check theRust documentation for more information.
About
rust wrapper for rocksdb
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.