anitnilay20 / anitnilay20/beatrix

Add UPDATE operation support for PostgreSQL

Offen
#4 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
high-priority postgres query-builder
Vorherrschende Sprache
Rust
Sterne
1
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## 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?;
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.