anitnilay20 / anitnilay20/beatrix
Add UPDATE operation support for PostgreSQL
- Lingua principale
- Rust
- Stelle
- 1
- Fork
- 0
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
## Description
Implement UPDATE functionality to allow modifying existing records in PostgreSQL.
## Requirements
- [ ] Implement UPDATE query builder
- [ ] Support WHERE clauses for targeted updates
- [ ] Handle partial updates (only changed fields)
- [ ] Add proper validation
- [ ] Write comprehensive tests
## Acceptance Criteria
- User can call `User::update().set(User::name(), "New Name").where_clause(User::id().eq(1)).execute(&db)`
- Support for conditional updates
- Proper handling of concurrent updates
- Return affected row count
## Files to modify
- `beatrix_core/src/relational/update.rs` (new file)
- `beatrix_core/src/relational/mod.rs`
- `beatrix_macro/src/relational.rs`
## Example Usage
```rust
let affected = User::update()
.set(User::name(), "John Doe".to_string())
.where_clause(User::id().eq(1))
.execute(&db).await?;
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.