mirror of
https://github.com/Phundrak/georm.git
synced 2026-07-29 04:19:18 +02:00
feat: deprecate create_or_update in favour of upsert
The `create_or_update` method has been deprecated and replaced by `upsert` for clarity and consistency with common database terminology. This commit also removes the file `src/entity.rs` which has been forgotten in earlier commits and was no longer part of Georm.
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ async fn upsert_handles_generated_fields(pool: sqlx::PgPool) -> sqlx::Result<()>
|
||||
let mut modified_product = product.clone();
|
||||
modified_product.price = BigDecimal::from(1200);
|
||||
|
||||
let upserted = modified_product.create_or_update(&pool).await?;
|
||||
let upserted = modified_product.upsert(&pool).await?;
|
||||
|
||||
// price is updated
|
||||
assert_eq!(upserted.price, BigDecimal::from(1200));
|
||||
|
||||
Reference in New Issue
Block a user