Giter VIP home page Giter VIP logo

sled-extensions's Introduction

This is a fork of sled-extensions

As of December 4, 2020 this repo has not been updated at all...
In another year or so you can delete this repo from here.
I already deleted it on stormasm but felt I wanted a reference to it for a bit longer....

Sled Extensions

Wrappers around the Sled embedded database to permit storing structured data

Using Sled Extensions is much like using Sled. The Tree API mirrors Sled's directly, and the [Db] type is extended through traits.

use sled_extensions::{Config, DbExt};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let db = Config::default().temporary(true).open()?;
    let tree = db.open_json_tree::<usize>("json-tree")?;

    tree.insert(b"hey", 32)?;

    if let Some(num) = tree.get(b"hey")? {
        assert_eq!(num, 32);
    } else {
        unreachable!("Shouldn't be empty");
    }

    Ok(())
}

Available features

  • bincode - Enable storing bincode-encoded data
  • cbor - Enable storing cbor-encoded data
  • json - Enable storing json-encoded data

Contributing

Unless otherwise stated, all contributions to this project will be licensed under the CSL with the exceptions listed in the License section of this file.

License

This work is licensed under the Cooperative Software License. This is not a Free Software License, but may be considered a "source-available License." For most hobbyists, self-employed developers, worker-owned companies, and cooperatives, this software can be used in most projects so long as this software is distributed under the terms of the CSL. For more information, see the provided LICENSE file. If none exists, the license can be found online here. If you are a free software project and wish to use this software under the terms of the GNU Affero General Public License, please contact me at [email protected] and we can sort that out. If you wish to use this project under any other license, especially in proprietary software, the answer is likely no.

sled-extensions's People

Contributors

stormasm avatar stormrust avatar

Watchers

James Cloos 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.