Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for timestamp with time zone
This adds support for the `timestamp with time zone` type. This is part of the SQL standard, but not supported explicitly by SQLite as far as I can tell. As such I've made it a PG specific type for now. timestamp with time zone does not actually mean that a time zone is stored. It instead means that when dealing with strings, Postgres will no longer ignore the time zone portion. It will convert the time zone to UTC for storage. When transmitted as text, it will be converted to the database's local time zone. When transmitted as binary, it will be sent as UTC. As such, I've provided `ToSql` implementations for basically all flavors of `DateTime`, but I've only provided a `FromSql` implementation for `DateTime<UTC>` and `NaiveDateTime`. I have not provided any implementation for `std::time::SystemTime`, as it implies local time zone for the machine and we do not have the tools to handle the conversion in the standard library. Fixes #106. Fixes #295. Fixes #402.
- Loading branch information
Showing
7 changed files
with
104 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters