oussama / ddb

Googles Datastore DB - High Level Rust API (with serde support!)

Home Page:https://crates.io/crates/ddb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Datastore DB

Googles Cloud Firestore in Datastore mode - High Level Rust API (with serde support!)

API Preview

// MODEL
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TodoItem {
    pub name: String,
    pub title: String,
}
// MODEL METADATA
impl EntityKey for TodoItem {
    fn entity_kind_key() -> String {
        String::from("TodoItem")
    }
    fn entity_name_key(&self) -> String {
        self.name.clone()
    }
}
// INIT
let db = DatastoreClient::new().unwrap();
let item = TodoItem {
    name: String::from("test"),
    title: String::from("lorem ipsum")
};
// GO!
db.upsert(item);

About

Googles Datastore DB - High Level Rust API (with serde support!)

https://crates.io/crates/ddb

License:MIT License


Languages

Language:Rust 100.0%