-
Notifications
You must be signed in to change notification settings - Fork 22
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 DATETIMEOFFSET #25
Comments
I poked around in the code base a little, to see if I could offer a pull request with a fix, but it's 20 years ago I did any C++ programming, and I've no experience with ODBC, so it was a bit too hard for me. (I do realise that this isn't written in C++, but there's too much stuff about interop with C++ that I don't understand. I can, on the other hand, write Haskell code, FWIW.) If you've oceans of patience, I'd be up for attempting a pull request, but I'm going to need a lot of hand-holding if I should make this work. Alternatively, I'd also be happy if anyone else creates a fix. |
It's just C code, not C++. But I think to implement this you don't have to touch any C. I think it'd probably be easier if I work on this, but I'm not likely to have time for a while. But here're some links relevant to the problem:
If you want to take a crack at it, you could start in here, it seems that you have to go via binary; so using getBinaryData, as done here. In this section you'd add a constant for Once you've got a You can reasonably add a constructor to the |
I completely understand. If I try to tackle this myself, I still think I'm going to need a bit more help than the above fine introduction, so I'm going to ask some more questions. Some of these are, I believe, questions that will need to be answered regardless of who implements the feature, but some of them will be the result of my ignorance. If you don't have time to answer, I completely understand.
Yes. One issue, however, is that One option is to wrap the I think we're going to have the same issue with I'd favour using a |
Good catch. I read up and it's intentional to avoid people thinking that 12:00UTC==13:00UTC-1 for example. That's fine. Makes sense to avoid people making mistakes. How about we decompose it into the two fields as |
Explicitly writing the |
I'm making some progress, but I'm having trouble figuring out how to extract the various parts from the data. I've been looking at the code that handles These seem to call some external C APIs defined in I've found this article that discusses both Is there some header file I can import into to |
FYI, it seems I'm making some progress 😅 |
This seems like a great library, but some version (I forget which one) of SQL Server introduced the
DATETIMEOFFSET
column time, and if one tries to query a table with such a column, an exception is thrown.Steps to reproduce
Create a tabel as follows:
Insert some data into it; e.g.
In GHCi, create a connection
conn
to the database, and attempt to usequery
to read the data:Expected result
The data from the database is printed in GHCi.
Actual result
An exception is thrown, as shown above.
The text was updated successfully, but these errors were encountered: