anitnilay20 / anitnilay20/beatrix

Implement transaction support for PostgreSQL

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
core high-priority postgres
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.