Rafael Epplée e77219f7c7
Add docs for fetch_all, example for postgres transactions (#1255)
* reference fetch_all() in query macros

* add example for using transactions in postgres
2021-08-16 16:33:42 -07:00

315 B

Postgres Transaction Example

A simple example demonstrating how to obtain and roll back a transaction with postgres.

Usage

Declare the database URL. This example does not include any reading or writing of data.

export DATABASE_URL="postgres://postgres@localhost/postgres"

Run.

cargo run