anitnilay20 / anitnilay20/beatrix

Add UPDATE operation support for PostgreSQL

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
high-priority postgres query-builder
Dominant language
Rust
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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

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.