toolu-orm-macros 0.2.0

Proc macros (Table, FromRow, relations) for toolu-orm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! `#[has_many(...)]` on a field that is neither `Vec<T>` nor `Option<T>` must fail.

use toolu_orm_macros::Relational;

#[derive(Relational)]
#[relational(table = "authors")]
struct Author {
  pub id: String,
  #[has_many(table = "posts", foreign_key = "author_id", columns = ["id"])]
  pub posts: String,
}

fn main() {
  let _ = Author {
    id: String::new(),
    posts: String::new(),
  };
}