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