removed the value field from attribute_definition because it's a definition and should not hold a value.
This commit is contained in:
@@ -101,7 +101,7 @@ utils::result<sql::query_result<sql::record>, utils::error> session::fetch_all(c
|
||||
// adjust columns from given query
|
||||
for (auto &col: q.prototype) {
|
||||
if (const auto rit = it->second.find(col.name()); rit != it->second.end()) {
|
||||
const_cast<object::attribute_definition &>(col).type(rit->type());
|
||||
const_cast<object::attribute_definition &>(col).change_type(rit->type());
|
||||
}
|
||||
}
|
||||
auto res = fetch(q);
|
||||
|
||||
@@ -39,7 +39,7 @@ std::string handle_column(sql::query_context &ctx, const sql::dialect *d, const
|
||||
ctx.column_aliases.insert({column_table->has_alias() ? column_table->alias() : column_table->name() + "." + col.column_name(), col.alias()});
|
||||
if (col.is_function()) {
|
||||
ctx.prototype.emplace_back(col.has_alias() ? col.alias() : col.column_name());
|
||||
ctx.prototype.back().type(utils::basic_type::type_int32);
|
||||
ctx.prototype.back().change_type(utils::basic_type::type_int32);
|
||||
} else {
|
||||
ctx.prototype.emplace_back(col.column_name());
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ utils::result<std::unique_ptr<statement_impl>, utils::error> connection::perform
|
||||
[&col](const auto &value) { return value.name() == col.name(); }
|
||||
);
|
||||
if (col.type() == utils::basic_type::type_null && rit != result->end()) {
|
||||
const_cast<object::attribute_definition&>(col).type(rit->type());
|
||||
const_cast<object::attribute_definition&>(col).change_type(rit->type());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user