FaunaDB offers an asynchronous (and synchronous) client for communicating with the Fauna database.
Goals:
The crate is not yet tested on production so use at your own risk.
``` rust use faunadb::prelude::*; use tokio; use futures::{future::lazy, Future};
fn main() { let client = ClientBuilder::new("put-your-secret-here").build().unwrap(); let params = DatabaseParams::new("my-first-database");
tokio::run(lazy(move || {
client
.query(CreateDatabase::new(params))
.map(|response| {
println!("{}", response);
})
.map_err(|error: faunadb::error::Error| {
println!("Error: {:?}", error);
})
}));
} ```
For tests to be successful, one must have the default Fauna Docker
image, using the default password
secret
.
Run the tests with:
bash
cargo test
The faunadb-rust crate is licensed under the Apache 2.0