Aragog
aragog is a fully featured ODM and OGM library for ArangoDB using the arangors driver.
The main concept is to provide behaviors allowing to map your structs with ArangoDB documents as simply an lightly as possible.
Inspired by Rails's Active Record library
aragog aslo provides hooks and validations for your models.
The crate also provides a powerful AQL querying tool allowing complex and safe ArangoDB queries in Rust.
Migrations CLI
aragog provides a safe schema generation and migrations command line interface: aragog_cli.
Book and Documentation
Cargo features
Async and Blocking
By default all aragog items are asynchronous, you can compile aragog in a synchronous build using the blocking feature:
= { = "0.10", = ["blocking"], = false }
You need to disable the default features. Don't forget to add the derive feature to use the derive macros.
Actix and Open API
If you use this crate with the actix-web framework, you may want the aragog errors to be usable as http errors.
To do so you can add to your cargo.toml the following feature: actix. This will add Actix 3 dependency and compatibility
= { = "0.10", = ["actix"] }
If you also want to be able to use paperclip, you may want aragog elements to be compatible.
To do so you can add to your cargo.toml the following feature: open-api.
= { = "0.10", = ["actix", "open-api"] }
Password hashing
You may want aragog to provide a more complete Authenticate trait allowing to hash and verify passwords.
To do so you can add to your cargo.toml the following feature: password_hashing.
= { = "0.10", = ["password_hashing"] }
It will add two functions in the Authenticate trait:
;
;
hash_passwordwill return a Argon2 encrypted password hash you can safely store to your databaseverify_passwordwill check if the providedpasswordmatches the Argon2 encrypted hash you stored.
The Argon2 encryption is based on the argonautica crate.
That crate requires the clang lib, so if you deploy on docker you will need to install it or define a custom image.
Minimal Traits
If you don't need the following traits:
AuthenticateAuthorizeActionNewUpdate
You can disable them with the minimal_traits feature:
= { = "0.10", = ["minimal_traits"] }
License
aragog is provided under the MIT license. See LICENSE.