GithubHelp home page GithubHelp logo

jgarzik / gdbm-native-rs Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 506 KB

Rust crate library for reading/writing GDBM key/value databases

License: MIT License

Rust 94.21% Shell 0.21% C++ 5.58%
rust rust-library rust-crate gdbm key-value key-value-database key-value-store library

gdbm-native-rs's Introduction

gdbm-native

Rust crate library for reading/writing GDBM key/value databases

Goals

  • Read and Write GDBM databases
  • Written in safe, native Rust (no FFI).
  • Better-than-C: Support all 32-/64-bit and big/little endian variants without recompiling.
  • Tuned for modern machines with solid state storage

Status

Alpha: Read-only access works well. Do not use in production.

Major categories of tasks leading to 1.0.0. View the list of issues and milestones for more.

  • Open/Close
  • Fetch: Get record data by key
  • Iterate: First-key/Next-key operations
  • Iterate v2: Rust Iterator
  • Count: Iterate db and count all records
  • Exists: Quick key-exists test
  • Insert: Store record
  • Remove: Delete record
  • Reorganize: Not a priority
  • Sync: Write dirty buffers, and fsync(2)
  • Import: GDBM ASCII and binary dump formats
  • Export: GDBM ASCII and binary dump formats
  • Numsync: New, 3rd generation GDBM file format
  • Tests: Healthy test coverage
  • Code Cleanup: Review by rust experts

Documentation

The best documentation is the original GDBM source code from the GNU project: https://www.gnu.org.ua/software/gdbm/

A sister project also provides additional technical documentation, including file format information.

gdbm-native-rs's People

Contributors

jgarzik avatar

Stargazers

@RandyMcMillan avatar  avatar  avatar Andrey Ermilov avatar Tyler Neely avatar Mutalisk avatar

Watchers

 avatar James Cloos avatar  avatar

gdbm-native-rs's Issues

API: Rust iterator

A native iterator. Here is sled's example:

// Iterates over key-value pairs, starting at the given key.
let scan_key: &[u8] = b"a non-present key before yo!";
let mut iter = db.range(scan_key..);
assert_eq!(&iter.next().unwrap().unwrap().0, b"yo!");
assert_eq!(iter.next(), None);

Multi-endian support

The matrix of data structure support should take into account

  • Support for 32-bit or 64-bit off_t
  • Support for runtime switching between big endian and little endian

Initial read-only tests

Initial set of read-only tests based on pre-generated databases + pre-generated test results (ideally generated by libgdbm and a C program).

API: Import/Binary binary dump format

Not a priority. The ASCII dump format (#9) is preferred and has priority.

Not assigning to a dev or milestone, but a volunteer is welcome to take the task.

Clean up API

Clean up based on Rust standards, by people who know Rust far better than I

API: Compare-and-swap

It is feasible to support a compare-and-swap API, a la sled's:

// Atomic compare-and-swap.
db.compare_and_swap(
    b"yo!",      // key
    Some(b"v1"), // old value, None for not present
    Some(b"v2"), // new value, None for delete
)
.unwrap();

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.