Crates.io | faunadb |
lib.rs | faunadb |
version | 0.1.0-alpha.1 |
source | src |
created_at | 2019-06-10 13:47:27.991375 |
updated_at | 2019-09-14 18:57:19.448027 |
description | A Client for Fauna Database |
homepage | https://github.com/prisma/faunadb-rust/ |
repository | https://github.com/prisma/faunadb-rust/ |
max_upload_size | |
id | 140178 |
size | 328,093 |
FaunaDB offers an asynchronous client for communicating with the Fauna database.
Goals:
The crate is not yet tested on production so use at your own risk.
use faunadb::prelude::*;
#[tokio::main]
async fn main() -> std::result::Result<(), faunadb::error::Error> {
let client = Client::builder("put-your-secret-here").build()?;
let params = DatabaseParams::new("my-first-database");
let response = client.query(CreateDatabase::new(params)).await?;
let res = response.resource;
assert_eq!(Some("my-first-database"), res["name"].as_str())
Ok(())
}
For tests to be successful, one must have the default Fauna Docker
image, using the default password
secret
.
Run the tests with:
cargo test
The faunadb-rust crate is licensed under the Apache 2.0