firestore-0.2.0 has been yanked.
Firestore for Rust
Library provides a simple API for Google Firestore:
- Create or update documents using Rust structures and Serde;
- Support for querying / streaming / listening documents from Firestore;
- Full async based on Tokio runtime;
- Macro that helps you use JSON paths as references to your structure fields;
- Caching Google client based on gcloud-sdk library that automatically detects tokens or GKE environment;
Quick start
Cargo.toml:
[]
= "0.2"
Example code:
// Create an instance
let db = new.await?;
const TEST_COLLECTION_NAME: &'static str = "test";
let my_struct = MyTestStructure ;
// Remove if it already exist
db.delete_by_id.await?;
// Let's insert some data
db.create_obj.await?;
// Update some field in it
let updated_obj = db.update_obj.await?;
println!;
// Get object by id
let find_it_again: MyTestStructure = db.get_obj.await?;
println!;
// Query our data
let objects: = db.query_obj.await?;
println!;
All examples available at examples directory.
To run example use with environment variables:
# PROJECT_ID=<your-google-project-id> cargo run --example simple-crud
Licence
Apache Software License (ASL)
Author
Abdulla Abdurakhmanov