Rincon Session
The [rincon_session] crate provides a convenient API for synchronous communication with an ArangoDB server.
The rincon_session API is a higher level API on top of the rincon_client API and provides additional features:
- Convenient API for applications to communicate to an ArangoDB server. (READY) E.g. no need to manually specify the database and collection on each and every request.
- Efficient handling of connections to the ArangoDB server (PLANNED)
- Efficient execution of batch operations (PLANNED)
- Convenient API for transaction handling (PLANNED)
Here is an example on how inserting a new document into an existing collection looks like:
// obtain a session reference for the existing collection named `customers`
let collection = database.use_collection_with_name;
let customer = Customer ;
// insert the document and get the document header with document id, key and revision
let document_header = collection.insert_document.unwrap;
The [rincon_session] crate is part of the Rincon ArangoDB Rust driver project.
Note: A similar but asynchronous API is provided by the rincon_session_async crate which is also part of the Rincon project.
Usage
To use the synchronous session API of this crate add this to your Cargo.toml
:
[]
= "0.1"
= "0.1"
= "0.1"
And this to your crate root:
extern crate rincon_core;
extern crate rincon_connection;
extern crate rincon_session;
Important: As [rincon_session] depends on rincon_client it re-exports the crate features of rincon_client. Therefore please make sure that you specify the features for [rincon_session] that are suitable for the setup of your ArangoDB server the same way as specified for the rincon_client crate.
For example to use [rincon_session] with an ArangoDB server configured to use RocksDB in a cluster specify the dependency with features like so:
[]
= { = "0.1", = false, = ["rocksdb", "cluster"] }
License
Licensed under Apache License, Version 2.0 see LICENSE or http://www.apache.org/licenses/LICENSE-2.0 for details.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.