diff options
author | Cara Salter <cara@devcara.com> | 2023-04-15 11:24:28 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2023-04-15 11:24:28 -0400 |
commit | ac4a926685c754f4af5adb20edf6eb23e2a0f18a (patch) | |
tree | 2a28e7c798ed1f845bd38a7d5cd0ba465782fb80 /include | |
parent | 5058c8bbeff6b659787a8ab482ac89fc4a194076 (diff) | |
download | 142bot-ac4a926685c754f4af5adb20edf6eb23e2a0f18a.tar.gz 142bot-ac4a926685c754f4af5adb20edf6eb23e2a0f18a.zip |
Automagically refresh spotify tokens
Change-Id: I883f28a88776e0a04b90e6d07c255a3fd9f05977
Diffstat (limited to 'include')
-rw-r--r-- | include/142bot/db.hpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/include/142bot/db.hpp b/include/142bot/db.hpp index f4f2769..0a82b84 100644 --- a/include/142bot/db.hpp +++ b/include/142bot/db.hpp @@ -94,13 +94,25 @@ namespace pqxx { return asdf::to_iso8601_str( ts ); } + + static char* into_buf(char* begin, char* end, asdf::timestamp const &value) { + return pqxx::internal::generic_into_buf(begin, end, value); + } + + static zview to_buf(char* begin, char* end, asdf::timestamp const &value) { + return pqxx::string_traits<std::string>::to_buf(begin, end, asdf::to_iso8601_str(value)); + } + + static std::size_t size_buffer(asdf::timestamp const &value) noexcept { + return pqxx::string_traits<std::string>::size_buffer(asdf::to_iso8601_str(value)) + 1; + } }; template<> struct nullness<asdf::timestamp> { static constexpr bool has_null = false; static constexpr bool always_null = false; - static constexpr bool is_null(asdf::timestamp* t) noexcept { - return t == nullptr; + static constexpr bool is_null(asdf::timestamp t) noexcept { + return false; } static constexpr asdf::timestamp *null() { return nullptr; } }; |