query/include/matador/sql/column.hpp

32 lines
793 B
C++

#ifndef QUERY_COLUMN_HPP
#define QUERY_COLUMN_HPP
#include "matador/sql/types.hpp"
#include "matador/utils/field_attributes.hpp"
#include <any>
namespace matador::sql {
class column {
public:
template<typename Type>
explicit column(std::string name, utils::field_attributes attr = utils::null_attributes)
: column(std::move(name), data_type_traits<Type>::data_type(), attr)
{}
column(std::string name, data_type_t type, utils::field_attributes attr = utils::null_attributes);
[[nodiscard]] const std::string& name() const;
[[nodiscard]] const utils::field_attributes& attributes() const;
[[nodiscard]] data_type_t type() const;
private:
std::string name_;
utils::field_attributes attributes_;
data_type_t type_{};
std::any value_;
};
}
#endif //QUERY_COLUMN_HPP