mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibSQL: Add a helper to convert a SQL::Value to a UnixDateTime
Support for constructing a Value from a UnixDateTime was added in commit
effcd080ca
.
That constructor just stores the value as the number of milliseconds
since epoch. There's no way for outside users to know this, so this adds
a helper to retrieve the value as a UnixDateTime and let SQL::Value be
the source of truth for how the value is encoded/decoded.
This commit is contained in:
parent
1205d39fc3
commit
cd0e07f6a4
3 changed files with 44 additions and 0 deletions
|
@ -77,6 +77,7 @@ public:
|
|||
[[nodiscard]] ByteString to_byte_string() const;
|
||||
[[nodiscard]] Optional<double> to_double() const;
|
||||
[[nodiscard]] Optional<bool> to_bool() const;
|
||||
[[nodiscard]] Optional<UnixDateTime> to_unix_date_time() const;
|
||||
[[nodiscard]] Optional<Vector<Value>> to_vector() const;
|
||||
|
||||
template<Integer T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue