Skip to content
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

datetimeoffset support #48

Merged
merged 6 commits into from
May 27, 2022
Merged

Conversation

spencerjanssen
Copy link
Contributor

Code is thanks to @ploeh from #25 which I've rebased onto master and fixed the Hashable instance.

Tests pass. I've also done some testing in my employer's code base and everything seems to work properly. How do we feel about merging this?

@spencerjanssen
Copy link
Contributor Author

Just checking in: is there anything I can do to help get this merged? We've been running on these patches in my employer's code base for a couple months now and we haven't experienced any issues.

Copy link
Member

@psibi psibi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this LGTM apart from some minor change requests. Can you also update changelog ?

src/Database/ODBC/SQLServer.hs Show resolved Hide resolved
@@ -773,6 +776,43 @@ getData dbc stmt i col = fmap (col, ) $
(fmap fromIntegral (odbc_TIME_STRUCT_hour datePtr)) <*>
(fmap fromIntegral (odbc_TIME_STRUCT_minute datePtr)) <*>
(fmap fromIntegral (odbc_TIME_STRUCT_second datePtr))))
| colType == sql_ss_timestampoffset ->
withCallocBytes
20 -- The TIMESTAMPOFFSET_STRUCT contains 3 SQLSMALLINTs,
Copy link
Member

@psibi psibi May 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit pick: I would use the #size (from hsc2hs) macro to compute it ? But free feel to ignore it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that the size constant is not ideal. Since you're OK with it I will leave it as is, rather than introduce hsc2hs.

@spencerjanssen
Copy link
Contributor Author

@psibi thanks for the feedback! Made the updates you requested, except for the hardcoded size.

@psibi psibi merged commit 38e0434 into fpco:master May 27, 2022
@psibi
Copy link
Member

psibi commented May 27, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants