mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 13:20:59 +00:00
19 lines
315 B
Markdown
19 lines
315 B
Markdown
# 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
|
|
```
|
|
|