2 releases

Uses old Rust 2015

0.1.1 Mar 12, 2020
0.1.0 Mar 11, 2020

#2227 in Database interfaces

Download history 102/week @ 2024-07-20 110/week @ 2024-07-27 197/week @ 2024-08-03 199/week @ 2024-08-10 134/week @ 2024-08-17 113/week @ 2024-08-24 149/week @ 2024-08-31 116/week @ 2024-09-07 31/week @ 2024-09-14 144/week @ 2024-09-21 27/week @ 2024-09-28 147/week @ 2024-10-05 83/week @ 2024-10-12 7/week @ 2024-10-19 19/week @ 2024-10-26 24/week @ 2024-11-02

134 downloads per month

Sleepycat

45KB
855 lines

Status

CI crates.io badge docs.rs badge

libdb-rs

Statically linked rust bindings for Berkeley DB.

This is a humble fork from jesterpm's libdb-rs.

Features

v4_8 uses bindings for Berkeley DB 4.8.x.

v5_3 uses bindings for Berkeley DB 5.3.x.

By default, Berkeley DB 5.3.x is used.

Example

extern crate libdb;

let env = libdb::EnvironmentBuilder::new()
    .flags(libdb::DB_CREATE | libdb::DB_RECOVER | libdb::DB_INIT_TXN | libdb::DB_INIT_MPOOL)
    .open()
    .unwrap();

let txn = env.txn(None, libdb::DB_NONE).unwrap();

let db = libdb::DatabaseBuilder::new()
    .environment(&env)
    .transaction(&txn)
    .db_type(libdb::DbType::BTree)
    .flags(libdb::DB_CREATE)
    .open()
    .unwrap();

txn.commit(libdb::CommitType::Inherit).expect("Commit failed!");

let mut key   = String::from("key").into_bytes();
let mut value = String::from("value").into_bytes();
db.put(None, key.as_mut_slice(), value.as_mut_slice(), libdb::DB_NONE).expect("Put failed!");

let result = db.get(None, key.as_mut_slice(), libdb::DB_NONE).unwrap();
println!("{:?}", result);

crev

This crate has its author's crev review.

It is recommended to always use cargo-crev to verify the trustworthiness of each of your dependencies, including this one.

Berkeley DB licensing notice

Website: http://www.oracle.com/database/berkeley-db/

License: Sleepycat

Description:

The Berkeley Database (Berkeley DB) is a programmatic toolkit that
provides embedded database support for both traditional and
client/server applications. The Berkeley DB includes B+tree, Extended
Linear Hashing, Fixed and Variable-length record access methods,
transactions, locking, logging, shared memory caching, and database
recovery. The Berkeley DB supports C, C++, Java, and Perl APIs. It is
used by many applications, including Python and Perl, so this should
be installed on all systems.

Dependencies

~31MB
~706K SLoC