Code Monkey home page Code Monkey logo

unqlite.rs's Introduction

unqlite

A high-level UnQLite database engine wrapper.

travis-badge release-badge downloads docs-badge license-badge

NOTE: Some of the documents is stolen from UnQLite Official Website.

What is UnQLite?

UnQLite is a software library which implements a self-contained, serverless, zero-configuration, transactional NoSQL database engine. UnQLite is a document store database similar to [MongoDB], [Redis], [CouchDB] etc. as well a standard Key/Value store similar to [BerkeleyDB], [LevelDB], etc.

UnQLite is an embedded NoSQL (Key/Value store and Document-store) database engine. Unlike most other NoSQL databases, UnQLite does not have a separate server process. UnQLite reads and writes directly to ordinary disk files. A complete database with multiple collections, is contained in a single disk file. The database file format is cross-platform, you can freely copy a database between 32-bit and 64-bit systems or between big-endian and little-endian architectures.

Port to Rust

This crate is high-level UnQLite database wrapper for Rust. A low-level bindings wrapper is available as a seperated crate: unqlite-sys.

Usage

You can start with UnQLite constructors:

extern crate unqlite;

use unqlite::{UnQLite, Config, KV, Cursor};

fn main() {
    // The database memory is not handled by Rust, and the database is on-disk,
    // so `mut` is not neccessary.
    let unqlite = UnQLite::create_temp();
    // Use any type that can use as `[u8]`
    unqlite.kv_store("key", "a long length value").unwrap();
    unqlite.kv_store("abc", [1,2,3]).unwrap();

    let mut entry = unqlite.first();
    // Iterate records
    loop {
        if entry.is_none() { break; }

        let record = entry.expect("valid entry");
        let (key, value) = record.key_value();
        println!("* Go through {:?} --> {:?}", key, value);

        if value.len() > 10 {
            println!("** Delete key {:?} by value length", key);
            entry = record.delete();
        } else {
            entry = record.next();
        }
    }
    //panic!("for test");
}

Contributors

  • @bemyak
  • @chritchens
  • @wolandr
  • @timlyo
  • @dariusc93

unqlite.rs's People

Contributors

bemyak avatar chritchens avatar dariusc93 avatar kant avatar timlyo avatar waylon531 avatar wolandr avatar zitsen avatar

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.