1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#![allow(dead_code)]
use proc_macro::TokenStream;

mod auto_entity;
mod entity;
mod field_utils;
mod fields_parser;
mod location;
mod mutation;
mod order_by;
mod primary;
mod selected_entity;
mod selection;
mod template_record;
mod type_check;
mod type_extract;
mod utils;

use auto_entity::impl_auto_entity_macro;
use entity::impl_entity_macro;
use location::impl_location_macro;
use mutation::impl_mutation_macro;
use order_by::impl_order_by_macro;
use primary::impl_primary_macro;
use selected_entity::impl_selected_entity_macro;
use selection::impl_selection_macro;
use template_record::impl_template_record_by_macro;

#[proc_macro_derive(Primary, attributes(TableName))]
pub fn expand_primary_macro(input: TokenStream) -> TokenStream {
    impl_primary_macro(input)
}

#[proc_macro_derive(Location, attributes(TableName, UniqueIndex))]
pub fn expand_location_macro(input: TokenStream) -> TokenStream {
    impl_location_macro(input)
}

#[proc_macro_derive(Mutation)]
pub fn expand_mutation_macro(input: TokenStream) -> TokenStream {
    impl_mutation_macro(input)
}

#[proc_macro_derive(SelectedEntity)]
pub fn expand_selected_entity_macro(input: TokenStream) -> TokenStream {
    impl_selected_entity_macro(input)
}

#[proc_macro_derive(Selection)]
pub fn expand_selection_macro(input: TokenStream) -> TokenStream {
    impl_selection_macro(input)
}

#[proc_macro_derive(Entity, attributes(TableName, PrimaryKey))]
pub fn expand_entity_macro(input: TokenStream) -> TokenStream {
    impl_entity_macro(input)
}

#[proc_macro_derive(OrderBy)]
pub fn expand_order_by_macro(input: TokenStream) -> TokenStream {
    impl_order_by_macro(input)
}

#[proc_macro_derive(TemplateRecord, attributes(TemplateSql, TemplateCountSql))]
pub fn expand_template_record_by_macro(input: TokenStream) -> TokenStream {
    impl_template_record_by_macro(input)
}

#[proc_macro_derive(
    Schema,
    attributes(TableName, PrimaryKey, UniqueIndex, AutoIncrement, Generated)
)]
pub fn expand_auto_entity_macro(input: TokenStream) -> TokenStream {
    impl_auto_entity_macro(input)
}