12 releases

✓ Uses Rust 2018 edition

0.1.0-alpha.1 Sep 14, 2019
0.0.12 Sep 14, 2019
0.0.11 Jul 3, 2019
0.0.9 Jun 21, 2019

#430 in Database interfaces

Download history 12/week @ 2020-03-14 36/week @ 2020-03-21 16/week @ 2020-03-28 13/week @ 2020-04-04 73/week @ 2020-04-11 1/week @ 2020-04-18 1/week @ 2020-04-25 1/week @ 2020-05-02 4/week @ 2020-05-16 13/week @ 2020-05-23 25/week @ 2020-05-30 14/week @ 2020-06-06 14/week @ 2020-06-13 3/week @ 2020-06-20 14/week @ 2020-06-27

83 downloads per month

Apache-2.0

225KB
5.5K SLoC

FaunaDB Rust Client

FaunaDB offers an asynchronous client for communicating with the Fauna database.

Goals:

  • Typesafe
  • Allocating only when really needed
  • Asynchronous, async/await

The crate is not yet tested on production so use at your own risk.

Basic Usage

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(())
}

Testing

For tests to be successful, one must have the default Fauna Docker image, using the default password secret.

Run the tests with:

cargo test

License

The faunadb-rust crate is licensed under the Apache 2.0

Dependencies

~5–7MB
~134K SLoC