This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
ood_persistence/examples
2021-10-21 23:56:47 +03:00
..
web chore: rename error type and reexport error types 2021-10-21 23:56:47 +03:00
README.md chore: add simple examples 2021-10-21 01:18:14 +03:00
simple.rs chore: add simple examples 2021-10-21 01:18:14 +03:00
transaction.rs chore: add simple examples 2021-10-21 01:18:14 +03:00

Examples

By default, all examples in this directory require a postgres server, which you can run using docker-compose.dev.yml in the examples/web directory.

Simple

This example initializes persistence, gets a connection and runs the query.

cargo run --example simple --features r2d2_postgres

Transaction

This is extended simple example where we also upgrade existing connection to transaction and run query. Then we close transaction and use connection.

cargo run --example transaction --features "nightly r2d2_postgres"