datom-rs

An open-source database inspired by Datomic

use datom::{
    prelude::*,
    sled::SledConnection,
    Transaction, ID, Value,
};

let conn = SledConnection::connect_temp("my_database")?;

let username = ID::new();
let user = ID::new();

let mut tx = Transaction::new();
tx.add(user.into(), username.into(), "pmc".into());
conn.transact(tx)?;

let db = conn.db()?;
if let Some(Value::String(u)) = db.entity(user.into())?.get(username.into())? {
    println!("pmc's username is {}.", u);
}

Versions

Version Cargo.toml line Documentation Source
v0.1.1-pre datom = "0.1.1-pre" docs.rs GitHub
v0.1.1-pre2 datom = "0.1.1-pre2" docs.rs GitHub
Development datom = { git = "https://github.com/LutrisEng/datom-rs" } os.lutris.engineering GitHub
// SPDX-FileCopyrightText: 2021 Lutris Engineering, Inc
// SPDX-License-Identifier: BlueOak-1.0.0 OR BSD-2-Clause-Patent