OOD Persistence

Crates.io Documentation unsafe forbidden

Asynchronous and synchronous interfaces and persistence implementations for your OOD architecture

Installation

Add ood_persistence = { version = "0", features = ["<IMPLEMENTATION_NAME>"] } as a dependency in Cargo.toml.

NOTE: change <IMPLEMENTATION_NAME> to feature name from available list. See Cargo.toml for more information.

Cargo.toml example:

```toml [package] name = "my-crate" version = "0.1.0" authors = ["Me user@rust-lang.org"]

[dependencies] oodpersistence = { version = "0", features = ["bb8postgres"] } ```

In stable rust channel you can use only connection interface, but if you use nightly channel, add an additional "nightly" feature to your Cargo.toml and you can use transactions as well.

Usage

```rust fn main() -> Result<(), Box> { // create pool to our database let pool = createpostgrespool(); // initialize persistence let persistence = oodpersistence::r2d2postgres::new(&pool); // get connection to database let mut conn = persistence.getconnection()?; // we can query something let res: i32 = conn.inner().queryone("select 1", &[])?.get(0); assert_eq!(res, 1);

Ok(())

} ```

See examples directory for more information.

Contributors

pleshevskiy (Dmitriy Pleshevskiy) – creator, maintainer.