query builder progress

This commit is contained in:
Sascha Kühl
2025-12-02 16:19:13 +01:00
parent c156ab5e74
commit bfbbd4c589
31 changed files with 348 additions and 164 deletions
+7 -18
View File
@@ -6,7 +6,7 @@
namespace matador::object {
attribute::attribute(std::string name)
: attribute(std::move(name), utils::basic_type::type_null, {}, null_option_type::NOT_NULL) {
: attribute(std::move(name), utils::basic_type::type_null, {}, null_option_type::NotNull) {
}
attribute::attribute(std::string name,
@@ -14,8 +14,9 @@ attribute::attribute(std::string name,
const utils::field_attributes &attr,
const null_option_type null_opt)
: name_(std::move(name))
, options_{attr, null_opt}
, type_(type)
, options_(attr)
, null_option_(null_opt)
{}
const std::string &attribute::name() const {
@@ -30,20 +31,16 @@ std::string attribute::full_name() const {
return owner_ ? owner_->name() + "." + name_ : name_;
}
int attribute::index() const {
return options_.index;
}
const utils::field_attributes &attribute::attributes() const {
return options_.attributes;
return options_;
}
utils::field_attributes& attribute::attributes() {
return options_.attributes;
return options_;
}
bool attribute::is_nullable() const {
return options_.null_option == null_option_type::NULLABLE;
return null_option_ == null_option_type::Nullable;
}
utils::basic_type attribute::type() const {
@@ -54,16 +51,8 @@ object* attribute::owner() const {
return owner_;
}
// const std::string& attribute::table_name() const {
// return owner_ ? owner_->name() : "";
// }
//
// void attribute::table_name( const std::string& name ) {
// table_name_ = name;
// }
void attribute::change_type(const utils::basic_type type, const utils::field_attributes& attr) {
options_.attributes = attr;
options_ = attr;
type_ = type;
}