Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlstsul/actix-sqlx-tx
Request-scoped sqlx transactions for actix-web
https://github.com/thlstsul/actix-sqlx-tx
actix-web rust sqlx transaction
Last synced: 10 days ago
JSON representation
Request-scoped sqlx transactions for actix-web
- Host: GitHub
- URL: https://github.com/thlstsul/actix-sqlx-tx
- Owner: thlstsul
- License: apache-2.0
- Created: 2022-11-26T18:55:33.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-26T20:56:17.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T12:13:18.543Z (16 days ago)
- Topics: actix-web, rust, sqlx, transaction
- Language: Rust
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `actix-sqlx-tx`
Request-bound [SQLx](https://github.com/launchbadge/sqlx) transactions for [actix-web](https://github.com/actix/actix-web);
Refer to [axum-sqlx-tx](https://github.com/wasdacraic/axum-sqlx-tx).## Summary
`actix-sqlx-tx` provides an `actix-web` [middleware](https://actix.rs/docs/middleware) for obtaining a request-bound transaction.
The transaction begins the first time the middleware is used, and is stored with the request for use by other middleware/handlers.
The transaction is resolved depending on the status code of the response – successful (`2XX`) responses will commit the transaction, otherwise it will be rolled back.See the [crate documentation](https://docs.rs/actix-sqlx-tx) for more information and examples.