Skip to content

Commit

Permalink
Remove lmdb feature
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Nov 21, 2023
1 parent 79da807 commit f20bd80
Show file tree
Hide file tree
Showing 24 changed files with 8 additions and 4,689 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ jobs:
- name: Test with db-int-key
run: cargo test --lib --no-default-features --features "db-int-key" --verbose

- name: Test with LMDB enabled
run: cargo test --all --features "lmdb" --verbose

- name: Test in release mode
run: cargo test --release --all --verbose

Expand Down
29 changes: 1 addition & 28 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,19 @@ documentation = "https://docs.rs/rkv"
edition = "2018"
exclude = ["/tests/envs/*"]
homepage = "https://github.com/mozilla/rkv"
keywords = ["lmdb", "database", "storage"]
keywords = ["database", "storage"]
license = "Apache-2.0"
name = "rkv"
readme = "README.md"
repository = "https://github.com/mozilla/rkv"
version = "0.19.0"
rust-version = "1.66"

[[bin]]
name = "rand"
path = "src/bin/rand.rs"
required-features = ["lmdb"]

[[bin]]
name = "dump"
path = "src/bin/dump.rs"
required-features = ["lmdb"]

[[test]]
name = "env-all"
required-features = ["lmdb"]

[[test]]
name = "env-lmdb"
required-features = ["lmdb"]

[[test]]
name = "env-migration"
required-features = ["lmdb"]

[features]
lmdb = ["lmdb-rkv"]
db-dup-sort = []
db-int-key = []
default = ["db-dup-sort", "db-int-key"]
no-canonicalize-path = []
with-asan = ["lmdb", "lmdb-rkv/with-asan"]
with-fuzzer = ["lmdb", "lmdb-rkv/with-fuzzer"]
with-fuzzer-no-link = ["lmdb", "lmdb-rkv/with-fuzzer-no-link"]

[dependencies]
arrayref = "0.3"
Expand All @@ -58,7 +32,6 @@ bitflags = {version = "2.4.1", features = ["serde"]}
byteorder = "1"
id-arena = "2.2"
lazy_static = "1.1"
lmdb-rkv = { version = "0.14", optional = true }
log = "0.4.20"
ordered-float = "3.0.0"
paste = "1.0.6"
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Documentation](https://docs.rs/rkv/badge.svg)](https://docs.rs/rkv/)
[![Crate](https://img.shields.io/crates/v/rkv.svg)](https://crates.io/crates/rkv)

The [rkv Rust crate](https://crates.io/crates/rkv) is a simple, humane, typed key-value storage solution. It supports multiple backend engines with varying guarantees, such as [LMDB](http://www.lmdb.tech/doc/) for performance, or "SafeMode" for reliability.
The [rkv Rust crate](https://crates.io/crates/rkv) is a simple, humane, typed key-value storage solution.

## ⚠️ Warning ⚠️

Expand All @@ -22,8 +22,6 @@ let shared_rkv = manager.get_or_create(path, Rkv::new::<SafeMode>).unwrap();

The "SafeMode" backend performs well, with two caveats: the entire database is stored in memory, and write transactions are synchronously written to disk (only on commit).

In the future, it will be advisable to switch to a different backend with better performance guarantees. We're working on either fixing some LMDB crashes, or offering more choices of backend engines (e.g. SQLite).

## Use

Comprehensive information about using rkv is available in its [online documentation](https://docs.rs/rkv/), which can also be generated for local consumption:
Expand All @@ -46,8 +44,6 @@ There are several features that you can opt-in and out of when using rkv:

By default, `db-dup-sort` and `db-int-key` features offer high level database APIs which allow multiple values per key, and optimizations around integer-based keys respectively. Opt out of these default features when specifying the rkv dependency in your Cargo.toml file to disable them; doing so avoids a certain amount of overhead required to support them.

To aid fuzzing efforts, `with-asan`, `with-fuzzer`, and `with-fuzzer-no-link` configure the build scripts responsible with compiling the underlying backing engines (e.g. LMDB) to build with these LLMV features enabled. Please refer to the official LLVM/Clang documentation on them for more informatiuon. These features are also disabled by default.

## Test

Test this project as you would test other Rust crates:
Expand Down
15 changes: 0 additions & 15 deletions src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,11 @@
// specific language governing permissions and limitations under the License.

mod common;
#[cfg(feature = "lmdb")]
mod impl_lmdb;
mod impl_safe;
mod traits;

pub use common::*;
pub use traits::*;

#[cfg(feature = "lmdb")]
pub use impl_lmdb::{
ArchMigrateError as LmdbArchMigrateError, ArchMigrateResult as LmdbArchMigrateResult,
ArchMigrator as LmdbArchMigrator, DatabaseFlagsImpl as LmdbDatabaseFlags,
DatabaseImpl as LmdbDatabase, EnvironmentBuilderImpl as Lmdb,
EnvironmentFlagsImpl as LmdbEnvironmentFlags, EnvironmentImpl as LmdbEnvironment,
ErrorImpl as LmdbError, InfoImpl as LmdbInfo, IterImpl as LmdbIter,
RoCursorImpl as LmdbRoCursor, RoTransactionImpl as LmdbRoTransaction,
RwCursorImpl as LmdbRwCursor, RwTransactionImpl as LmdbRwTransaction, StatImpl as LmdbStat,
WriteFlagsImpl as LmdbWriteFlags,
};

pub use impl_safe::{
DatabaseFlagsImpl as SafeModeDatabaseFlags, DatabaseImpl as SafeModeDatabase,
EnvironmentBuilderImpl as SafeMode, EnvironmentFlagsImpl as SafeModeEnvironmentFlags,
Expand Down
Loading

0 comments on commit f20bd80

Please sign in to comment.