Derive ID

License Cargo Documentation

A one size fits some NewType ID derive specifically tailored to integrate with Async GraphQL and Diesel. In particular, this allows for ID types that can be used in conjunction with diesel::associations::BelongsTo.

rust derive_id! { #[derive(Identifiable)] #[table_name = "content"] #[graphql(name = "ContentID")] pub struct ContentId(#[column_name = "id"] i32); }