anitnilay20 / anitnilay20/beatrix

Complete INSERT operation support for PostgreSQL

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

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.