feat(examples): add PostgreSQL example with user relationship

Adds an example demonstrating user, comment, and follower relationship
including:
- User management with profiles
- Comments (not really useful, just for showcasing)
- Follower/follozing relationships
- Ineractive CLI interface with CRUD operations
- Database migrations for the example schema
This commit is contained in:
2025-06-05 23:56:15 +02:00
parent 9e56952dc6
commit 190c4d7b1d
23 changed files with 1199 additions and 85 deletions
+4 -1
View File
@@ -60,7 +60,10 @@ async fn create_fails_if_already_exists(pool: sqlx::PgPool) -> sqlx::Result<()>
let result = author.create(&pool).await;
assert!(result.is_err());
let error = result.err().unwrap();
assert_eq!("error returned from database: duplicate key value violates unique constraint \"authors_pkey\"", error.to_string());
assert_eq!(
"error returned from database: duplicate key value violates unique constraint \"authors_pkey\"",
error.to_string()
);
Ok(())
}