feat: add foreign one_to_one relationships

This commit is contained in:
2025-03-02 16:07:30 +01:00
parent 4ff2df1a4e
commit aafbfb7964
13 changed files with 1667 additions and 291 deletions

View File

@@ -1,7 +1,12 @@
use georm::Georm;
#[derive(Debug, sqlx::FromRow, Georm, PartialEq, Eq, Default)]
#[georm(table = "biographies")]
#[georm(
table = "biographies",
one_to_one = [{
name = "author", remote_id = "biography_id", table = "authors", entity = Author
}]
)]
pub struct Biography {
#[georm(id)]
pub id: i32,