Skip to content

Commit

Permalink
Merge pull request #67 from XiNiHa/derive-features
Browse files Browse the repository at this point in the history
Conditionally add filter types list with features
  • Loading branch information
tyt2y3 authored Oct 5, 2022
2 parents 72ba42f + 2683438 commit a4209f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ sea-orm = { version = "^0.9", default-features = false }

[features]
default = []
with-chrono = ["sea-orm/with-chrono", "async-graphql/chrono"]
with-decimal = ["sea-orm/with-rust_decimal", "async-graphql/decimal"]
with-uuid = ["sea-orm/with-uuid"]
with-chrono = ["seaography-derive/with-chrono", "sea-orm/with-chrono", "async-graphql/chrono"]
with-decimal = ["seaography-derive/with-decimal", "sea-orm/with-rust_decimal", "async-graphql/decimal"]
with-uuid = ["seaography-derive/with-uuid", "sea-orm/with-uuid"]
8 changes: 7 additions & 1 deletion derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ quote = "1.0.21"
syn = { version = "1.0.99" }
proc-macro2 = "1.0.43"
bae = "0.1.7"
heck = "0.4.0"
heck = "0.4.0"

[features]
default = []
with-chrono = []
with-decimal = []
with-uuid = []
6 changes: 6 additions & 0 deletions derive/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ pub fn filter_struct(
"u64",
"f32",
"f64",
#[cfg(feature = "with-chrono")]
"Date",
#[cfg(feature = "with-chrono")]
"DateTime",
#[cfg(feature = "with-chrono")]
"DateTimeUtc",
#[cfg(feature = "with-decimal")]
"Decimal",
#[cfg(feature = "with-uuid")]
"Uuid",
"BinaryVector",
"bool",
];
Expand Down

0 comments on commit a4209f8

Please sign in to comment.