Skip to content

A Deadpool connection pool for ArangoDB using Arangors

Notifications You must be signed in to change notification settings

Weasy666/deadpool-arangodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deadpool for ArangoDB Unsafe forbidden Rust 1.54+

Deadpool is a dead simple async pool for connections and objects of any type.

This crate implements a deadpool manager for ArangoDB using arangors.

Features

Feature Description Extra dependencies Default
rt_tokio_1 Enable support for tokio crate,
through the usage of reqwest as http client
deadpool/rt_tokio_1, arangors/reqwest_async yes
rt_async-std_1 Enable support for async-std crate,
through the usage of surf as http client
deadpool/rt_async-std_1, arangors/surf_async no
serde Enable support for serde crate deadpool/serde, serde/derive no

Example

use deadpool_arangodb::{Config, Runtime};

#[tokio::main]
async fn main() {
    let mut cfg = Config {
        url: Some("http://localhost:8529".to_string()),
        username: Some("root".to_string()),
        password: Some("deadpool".to_string()),
        use_jwt: true,
        pool: None,
    };
    let pool = cfg.create_pool(Runtime::Tokio1).unwrap();
    let mut conn = pool.get().await.unwrap();

    let db = conn.create_database("deadpool_favorite_foods")
        .await.expect("Failed to create database: {:?}");

    // Do stuff with db...
}

License

Licensed under either of

at your option.

About

A Deadpool connection pool for ArangoDB using Arangors

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages