orientdb_client/
lib.rs

1//! Experimental Rust client for OrientDB.
2//! The driver supports sync and async.
3//!
4//!
5//! You can use orientdb-client this lines in your `Cargo.toml`
6//!
7//! ```toml
8//! [dependencies]
9//! orientdb-client = "*"
10//! ```
11//!
12//! Here it is an usage example:
13//!
14//! ```rust,no_run
15//!
16//! use orientdb_client::{OrientDB};
17//!
18//! fn main() -> Result<(), Box<std::error::Error>> {
19//!    let client = OrientDB::connect(("localhost",2424))?;
20//!
21//!    let session = client.session("demodb","admin","admin")?;
22//!
23//!    let results : Vec<_> = session.query("select from V where id = :param").named(&[("param", &1)]).run()?.collect();
24//!
25//!
26//!    println!("{:?}", results);
27//!
28//!    Ok(())
29//!}
30//!
31//!
32//! ```
33//!
34
35pub mod common;
36pub mod sync;
37
38#[cfg(feature = "async")]
39pub mod asynchronous;
40
41pub use common::types::error::OrientError;
42pub use common::ConnectionOptions;
43pub use sync::client::OrientDB;
44pub use sync::session::{OSession, SessionPool};
45
46pub type OrientResult<T> = Result<T, OrientError>;
47
48pub use common::DatabaseType;
49
50pub mod types {
51    pub use super::common::types::*;
52}
53
54#[cfg(feature = "async")]
55pub mod aio {
56    pub use crate::asynchronous::session::{OSession, SessionPool};
57    pub use crate::asynchronous::OrientDB;
58}
59
60#[cfg(feature = "sugar")]
61pub mod derive {
62    pub use orientdb_macro::FromResult;
63}