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
// SPDX-FileCopyrightText: 2021 Lutris Engineering, Inc
// SPDX-License-Identifier: BlueOak-1.0.0 OR BSD-2-Clause-Patent