From ac4a926685c754f4af5adb20edf6eb23e2a0f18a Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sat, 15 Apr 2023 11:24:28 -0400 Subject: Automagically refresh spotify tokens Change-Id: I883f28a88776e0a04b90e6d07c255a3fd9f05977 --- include/142bot/db.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'include') 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::to_buf(begin, end, asdf::to_iso8601_str(value)); + } + + static std::size_t size_buffer(asdf::timestamp const &value) noexcept { + return pqxx::string_traits::size_buffer(asdf::to_iso8601_str(value)) + 1; + } }; template<> struct nullness { 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; } }; -- cgit v1.2.3