-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support mssql's DateTime2 type via chrono #1681
Conversation
89836be
to
dfe3a12
Compare
Simplified the code to not require |
39fbcf0
to
b2a260c
Compare
I further improved the implementation by decoding |
@milgner It appears that the only flaw here is a lack of a Additionally, whether this is done in this PR or otherwise, enabling the |
Of course! I haven't had a chance this week to check on this but I'll gladly run it through cargo fmt and rebase it!
Not sure what the implications might be here. I think I'll try creating a separate branch and create a second PR for that. |
cee7e0c
to
6b44b23
Compare
Any possibilities to get this merged? |
I see that there are merge conflicts again. I can quickly resolve those if desired. But a short 👍 or 👎 would be appreciated so I don't have to resolve them anew every second week 😉 |
I really hope you get some 👍 for this. With #2073 it's the only thing preventing me from using sqlx for mssql. |
@@ -121,7 +121,7 @@ mssql = ["sqlx-core/mssql", "sqlx-macros/mssql"] | |||
# types | |||
bigdecimal = ["sqlx-core/bigdecimal", "sqlx-macros/bigdecimal"] | |||
decimal = ["sqlx-core/decimal", "sqlx-macros/decimal"] | |||
chrono = ["sqlx-core/chrono", "sqlx-macros/chrono"] | |||
with_chrono = ["sqlx-core/chrono", "sqlx-macros/chrono"] |
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.
Why rename the feature? This is a breaking change.
Thank you for taking the time to open this PR. However, we're now in the process of splitting out the MSSQL driver for our SQLx Pro offering and it will be rewritten from scratch to fix some longstanding issues, so we will not be accepting your contribution at this time. We'll make sure that the new MSSQL driver supports the datetime types via |
There was some previous conversation about it in #1251 but I didn't find any code in the current version of the repository to get it working. So I wrote my own version, based on the implementation from the
go-mssqldb
library.Unfortunately, In order to add it to have a full integration test for type casting, I had to add
chrono
to thedev-dependencies
inCargo.toml
. And since one cannot have features with the same name as a dependency, I had to rename the feature fromchrono
towith_chrono
.Any suggestions for improvement welcome.