query builder progress
This commit is contained in:
@@ -10,14 +10,9 @@
|
||||
namespace matador::object {
|
||||
|
||||
enum class null_option_type : uint8_t {
|
||||
NULLABLE, NOT_NULL
|
||||
Nullable, NotNull
|
||||
};
|
||||
|
||||
struct attribute_options {
|
||||
utils::field_attributes attributes;
|
||||
null_option_type null_option{null_option_type::NOT_NULL};
|
||||
int index{-1};
|
||||
};
|
||||
class object;
|
||||
class attribute_generator;
|
||||
|
||||
@@ -33,20 +28,17 @@ public:
|
||||
attribute() = default;
|
||||
attribute(std::string name,
|
||||
utils::basic_type type,
|
||||
const utils::field_attributes&,
|
||||
null_option_type null_opt);
|
||||
const utils::field_attributes &attr = utils::null_attributes,
|
||||
null_option_type null_opt = null_option_type::NotNull);
|
||||
|
||||
[[nodiscard]] const std::string& name() const;
|
||||
void name(const std::string& n);
|
||||
[[nodiscard]] std::string full_name() const;
|
||||
[[nodiscard]] int index() const;
|
||||
[[nodiscard]] const utils::field_attributes& attributes() const;
|
||||
[[nodiscard]] utils::field_attributes& attributes();
|
||||
[[nodiscard]] bool is_nullable() const;
|
||||
[[nodiscard]] utils::basic_type type() const;
|
||||
[[nodiscard]] object* owner() const;
|
||||
// [[nodiscard]] const std::string& table_name() const;
|
||||
// void table_name(const std::string& name);
|
||||
void change_type(utils::basic_type type, const utils::field_attributes &attr = utils::null_attributes);
|
||||
template < typename Type >
|
||||
void change_type(const utils::field_attributes &attr = utils::null_attributes) {
|
||||
@@ -75,8 +67,9 @@ private:
|
||||
|
||||
std::string name_;
|
||||
object *owner_{nullptr};
|
||||
attribute_options options_;
|
||||
utils::basic_type type_{utils::basic_type::type_null};
|
||||
utils::field_attributes options_{};
|
||||
null_option_type null_option_{null_option_type::NotNull};
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user