anitnilay20 / anitnilay20/beatrix
Implement transaction support for PostgreSQL
- Dominant language
- Rust
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Add transaction support to PostgreSQL backend for atomic operations and data consistency.
## Requirements
- [ ] Implement transaction management
- [ ] Support nested transactions (savepoints)
- [ ] Add automatic rollback on error
- [ ] Implement transaction isolation levels
- [ ] Add deadlock detection and retry logic
- [ ] Write comprehensive tests
## Acceptance Criteria
- Users can wrap operations in transactions
- Support for manual and automatic transaction management
- Proper error handling and rollback
- Support for different isolation levels
## Files to modify
- `beatrix_core/src/relational/transaction.rs` (new file)
- `beatrix_core/src/relational/db/postgres.rs`
## Example Usage
```rust
db.transaction(|tx| async move {
let user = User::insert().values(new_user).execute(&tx).await?;
let profile = Profile::insert().values(new_profile).execute(&tx).await?;
Ok((user, profile))
}).await?;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.