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§
pub use database::kv;
pub use database::table;
pub use database::table::types::TableRow;
pub use database::DocDb;
pub use database::KvDb;
pub use database::TableDb;
pub use utils::deserialize;
pub use utils::deserialize_bytevec;
pub use utils::deserialize_object;
pub use utils::normalize_type_name;
pub use utils::serialize;
pub use utils::serialize_object;
pub use utils::serialize_to_bytevec;
Modules§
- Underlying storage of the Key-Value database implementation