#google-api #data-store #web-api #google #ddb

bin+lib ddb

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

6 releases

0.0.6 Oct 23, 2019
0.0.5 Oct 2, 2019
0.0.1 Sep 30, 2019

#44 in #data-store

MIT license

32KB
699 lines

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);

Dependencies

~31–43MB
~851K SLoC