New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "with-time" feature #256
Conversation
pub fn is_date_time_utc(&self) -> bool { | ||
#[cfg(feature = "with-chrono")] | ||
#[cfg(any(feature = "with-chrono", feature = "with-time"))] | ||
return matches!(self, Self::DateTimeUtc(_)); | ||
#[cfg(not(feature = "with-chrono"))] | ||
#[cfg(not(any(feature = "with-chrono", feature = "with-time")))] | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could refactor all these feature guards by adding a marker feature, perhaps named _with-chrono-or-time
. This feature will be turned on if either with-chrono
or with-time
was enabled.
Then, we could simply check
#[cfg(feature = "_with-chrono-or-time")]
#[cfg(not(feature = "_with-chrono-or-time"))]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine either way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw... we should also tests if time
can be binded on various db drivers or not.
https://github.com/SeaQL/sea-query/tree/master/src/driver
what is the support matrix? |
Thank you so much for the contribution. I have a clearer thought by now: SO the problem is that it creates confusion. Cargo features are not supposed to be mutually exclusive, although quite a number of crates does so. Also, all-features does not compile. It will be hard to maintain in the long run if we support the two using mutually exclusive feature flags.
|
Actually, it might makes more sense to support both to coexist at the same time. |
This should be easier and a once off breaking change right? @billy1624 |
Yeah, this would be easier to just add |
Sounds good |
Closed in favour of #267 |
with-time
andwith-chrono
are mutually exclusive