anitnilay20 / anitnilay20/beatrix

Complete INSERT operation support for PostgreSQL

Aperta
#3 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
high-priority postgres query-builder
Lingua principale
Rust
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Description
Currently, Beatrix only supports SELECT operations for PostgreSQL. We need to implement INSERT functionality to allow creating new records.

## Requirements
- [ ] Implement INSERT query builder
- [ ] Add INSERT method to Select struct
- [ ] Support batch inserts
- [ ] Handle primary key generation
- [ ] Add proper error handling
- [ ] Write comprehensive tests

## Acceptance Criteria
- User can call `User::insert().values(user).execute(&db)`
- Support for single and batch inserts
- Proper handling of auto-increment fields
- Detailed error messages for constraint violations

## Files to modify
- `beatrix_core/src/relational/insert.rs` (new file)
- `beatrix_core/src/relational/mod.rs`
- `beatrix_macro/src/relational.rs`

## Example Usage
```rust
let user = User { name: "John".to_string(), email: "john@example.com".to_string() };
let result = User::insert().values(user).execute(&db).await?;
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.