Is there a Rust crate that implements the SQL date and interval types?
2
votes
1
answer
691
views
I went looking for a Rust crate (on lib.rs) that implements DateTime and found chrono.rs. However, I have two issues.
1. I cannot find a function that takes a string representing an SQL date and converts that into the external representation. I found a variety of conversion functions but they all require format strings specifying how the date is laid out in the string, but I don't know what the format specifier should be. The parser for SQL is simply handing me this date as a string and I don't know how the string is formatted. (The code I am parsing is one of the tpch queries, so it includes both a date and an interval, which I'm hoping can be converted to a "duration".)
2. The backend code which I am connecting to expects the date to be represented as a 64-bit unsigned integer. Is there a specific representation that is used for such?
(Note, I asked on the Rust discord server, but only got the answer that the task should be "easy".)
Asked by intel_chris
(141 rep)
Nov 8, 2021, 09:12 AM
Last activity: Jan 1, 2023, 11:01 PM
Last activity: Jan 1, 2023, 11:01 PM