aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/142bot/db.hpp16
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; }
};