ddb

Crates.ioddb
lib.rsddb
version0.0.6
sourcesrc
created_at2019-09-30 21:55:37.299828
updated_at2019-10-23 18:35:17.535596
descriptionDatastore DB - High Level Rust API (with serde support)
homepagehttps://github.com/colbyn/ddb
repositoryhttps://github.com/colbyn/ddb
max_upload_size
id168925
size119,079
Colbyn (colbyn)

documentation

README

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);
Commit count: 33

cargo fmt