https://github.com/gabor-boros/bb8-arangodb
ArangoDB driver for bb8 based on the arangors crate.
https://github.com/gabor-boros/bb8-arangodb
arangodb bb8 connection-manager connection-pool
Last synced: about 1 month ago
JSON representation
ArangoDB driver for bb8 based on the arangors crate.
- Host: GitHub
- URL: https://github.com/gabor-boros/bb8-arangodb
- Owner: gabor-boros
- License: apache-2.0
- Created: 2022-10-11T22:22:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T01:35:48.000Z (11 months ago)
- Last Synced: 2025-03-28T08:43:42.013Z (about 2 months ago)
- Topics: arangodb, bb8, connection-manager, connection-pool
- Language: Rust
- Homepage: https://docs.rs/bb8-arangodb/
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# bb8-arangodb
ArangoDB support for [bb8] based on the [arangors] crate.
The library supports all authentication methods supported by `arangors`,
defined by `AuthenticationMethod`.[bb8]: https://crates.io/crates/bb8
[arangors]: https://crates.io/crates/arangors## Installing
Make sure to add `bb8` and `bb8-arangodb` to your `Cargo.toml`, like:
```toml
[dependencies]
bb8 = "0.8"
bb8-arangodb = "0.1"
arangors = "0.5"
```## Example
```rust
use bb8::Pool;
use bb8_arangodb::{ArangoConnectionManager, AuthenticationMethod};
use arangors::uclient::reqwest::ReqwestClient;
use futures_util::join_all;#[tokio::main]
async fn main() {
let manager = ArangoConnectionManager::::new(
"http://localhost:8529".to_string(),
AuthenticationMethod::JWTAuth("root".to_string(), "openSesame".to_string())
);let pool = Pool::builder().max_size(5).build(manager).await.unwrap();
for _i in 0..10 {
let pool = pool.clone();handles.push(tokio::spawn(async move {
let conn = pool.get().await.unwrap();
let db = conn.db("test").await.unwrap();let result: Vec = db
.aql_str("FOR doc IN collection RETURN doc.name")
.await
.unwrap();println!("{:?}", results);
}))
}join_all(handles).await;
}
```## Running tests
To run tests, you'll need ArangoDB running locally. To run tests using docker,
execute the following commands after cloning the repository:```shell
# Starting ArangoDB in a detached docker container
docker run -d -p 8529:8529 -e ARANGO_ROOT_PASSWORD=openSesame --name arangodb arangodb/arangodb:3.10.0# Wait some seconds to let ArangoDB start and run tests
cargo test# Stop and remove the ArangoDB container
docker stop arangodb && docker rm arangodb
```## Releases
Detailed release notes are available in this repo at [CHANGELOG.md].
[CHANGELOG.md]: CHANGELOG.md
## Reporting issues
Found a bug? We'd love to know about it!
Please report all issues on the GitHub [issue tracker][issues].
[issues]: https://github.com/gabor-boros/bb8-arangodb/issues
## Contributing
See the **[bb8-arangodb Contributor Guide]** for a complete introduction
to contributing to `bb8-arangodb`.## License
`bb8-arangodb` is primarily distributed under the terms of both the MIT license
and the Apache License (Version 2.0).See [LICENSE-MIT] and [LICENSE-APACHE] for details.
[LICENSE-MIT]: LICENSE-MIT
[LICENSE-APACHE]: LICENSE-APACHE