Update :utc_datetime handling#49
Conversation
Yes we should probably alter that there as well.
In theory SQLite3 should shift the offsets upon writing the record to UTC. Not 100% certain on that, but I swear I remember reading it in the sqlite documentation. |
|
Maybe here:
|
2ee6287 to
5dd8eac
Compare
|
Yea that's where I saw it. 👍🏻 |
|
@LostKobrakai if you can, will you go update the |
|
I can do that, I'm just not sure if I should go with an Exception for non UTC datetimes like the other adapters, or an error tuple like everything else seems to be. |
|
I modeled both this adapter and the client library to be close to how MyXQL handles things. If either postgrex or myxql raise an exception for that, let's do that to keep parity. |
This changes the handling of
:utc_datetimeto not write offsets to the db and ignore them when fetching.I'm wondering if this one should be changed as well though.
https://github.com/elixir-sqlite/exqlite/blob/a173dc87e6094a7beb535773b989d596461a3a75/lib/exqlite/sqlite3.ex#L170
It seems neither postgrex nor myxql support
%DateTime{}s not being supplied in UTC:Postgrex:
https://github.com/elixir-ecto/postgrex/blob/60abc91d7d64155e9d5fe587178e063b1083f668/lib/postgrex/extensions/timestamptz.ex#L52-L54
MyXQL:
https://github.com/elixir-ecto/myxql/blob/fdb147dba07d7699c4af23448996ae7f4663bce6/lib/myxql/protocol/values.ex#L341-L343
The mssql/tds driver seems to have a type for datetimes with offsets.
https://github.com/livehelpnow/tds/blob/36f228275c2bfde2baa45fe70d29d1eb1d44379b/lib/tds/types.ex#L1775-L1788
Usable with custom ecto types it seems: elixir-ecto/tds#111 (comment)
This PR will currently ignore any offsets, given there's no clear path on how to handle the offset if there is one.
Closes #46