Crate icbiadb

Source
Expand description

A lightweight database implementation for KV, table and document databases.

§Notes

Bincode serialization defaults integers to i32/u32 and f32 for floats without any explicit declarations

§Key-Value example

use icbiadb::storage::BTreeMap;

let mut db = icbiadb::kv::create::<BTreeMap>("my_kvs.idb").unwrap();
db.set("hello:world", 100);
db.commit();

See KvDb for all methods.

§Table example

use icbiadb::if_not_exists_create;

let mut db = icbiadb::table::create("my_tables.idb").unwrap();

if_not_exists_create! {db, "articles",
    (title: String, date: String[unique])
};

let mut record = icbiadb::TableRow::default();
record.set_col("title", "A short title");
record.set_col("date", "today");
db.insert_row("articles", record);

db.commit();

Re-exports§

Modules§

Macros§