@@ -47,9 +47,7 @@ pub fn derive_insertable(input: proc_macro::TokenStream) -> proc_macro::TokenStr
47
47
#[ derive( FromDeriveInput , Debug ) ]
48
48
#[ darling( attributes( medici) ) ]
49
49
struct ChangesetOpts {
50
- pub table_name : String ,
51
50
pub table_struct : String ,
52
- pub primary_key : Option < String > ,
53
51
}
54
52
55
53
#[ proc_macro_derive( Changeset , attributes( medici) ) ]
@@ -66,21 +64,16 @@ pub fn derive_changeset(input: proc_macro::TokenStream) -> proc_macro::TokenStre
66
64
let fields_to_stringify = fields. iter ( ) . map ( |field| field. unraw ( ) ) ;
67
65
let number_of_fields = fields. len ( ) ;
68
66
69
- let table_name = opts. table_name ;
70
67
let table_struct = parse_table_struct ( opts. table_struct ) ;
71
68
72
- let primary_key_column = opts. primary_key . unwrap_or ( "id" . into ( ) ) ;
73
-
74
- let expanded = quote ! {
69
+ quote ! {
75
70
#[ :: async_trait:: async_trait]
76
71
#[ automatically_derived]
77
72
impl Changeset <#number_of_fields> for #name {
78
73
type T = #table_struct;
79
74
80
75
const COLUMNS : [ & ' static str ; #number_of_fields] =
81
76
[ #( stringify!( #fields_to_stringify) ) , * ] ;
82
- const TABLE_NAME : & ' static str = #table_name;
83
- const PRIMARY_KEY_COLUMN : & ' static str = #primary_key_column;
84
77
85
78
fn bind(
86
79
self ,
@@ -113,9 +106,7 @@ pub fn derive_changeset(input: proc_macro::TokenStream) -> proc_macro::TokenStre
113
106
other == self
114
107
}
115
108
}
116
- } ;
117
-
118
- expanded. into ( )
109
+ } . into ( )
119
110
}
120
111
121
112
fn filtered_struct_fields < T > (
0 commit comments