12 const type &get_type()
const {
return type_; }
14 const nullable_datum &get_nullable_datum()
const {
return datum_; };
24 std::optional<memory_context>) {
40 bool is(
const type &t) {
return !value_.has_value() || (*value_).get().get_type() == t; }
41 constexpr type type_for() {
42 if (value_.has_value()) {
43 return (*value_).get().get_type();
45 throw std::runtime_error(
"can't determine type for an uninitialized value");
49 std::optional<std::reference_wrapper<value>> value_;
A trait to convert from and into a cppgres::datum.
Definition: datum.hpp:110
static T from_datum(const datum &, const oid, std::optional< memory_context > context=std::nullopt)=delete
Convert from a datum.
static T from_nullable_datum(const nullable_datum &d, const oid oid, std::optional< memory_context > context=std::nullopt)=delete
Convert from a nullable datum.
static datum into_datum(const T &d)=delete
Convert datum into a type.
static nullable_datum into_nullable_datum(const T &d)=delete
Convert into a nullable datum.
Postgres type.
Definition: type.hpp:20