fixed core- and orm-tests. postgres-tests needs some work
This commit is contained in:
@@ -57,7 +57,7 @@ matador::utils::result<void, matador::utils::error> matador::orm::schema::create
|
||||
// std::cout << result.sql << std::endl;
|
||||
for (const auto &node: repo_) {
|
||||
auto ctx = query::query::create()
|
||||
.table(node->name(), node->info().definition()->columns())
|
||||
.table(node->name(), node->info().attributes())
|
||||
.compile(*c);
|
||||
|
||||
for ( const auto& [sql, command] : ctx.additional_commands ) {
|
||||
|
||||
@@ -52,7 +52,7 @@ utils::result<void, utils::error> session::create_schema() const {
|
||||
auto c = cache_.pool().acquire();
|
||||
for (const auto &node: *schema_) {
|
||||
auto ctx = query::query::create()
|
||||
.table(node->name(), node->info().definition()->columns())
|
||||
.table(node->name(), node->info().attributes())
|
||||
.compile(*c);
|
||||
|
||||
for ( const auto& [sql, command] : ctx.additional_commands ) {
|
||||
@@ -100,7 +100,9 @@ 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()) {
|
||||
if (const auto rit = std::find_if(it->second.begin(), it->second.end(), [&col](const auto &value) {
|
||||
return value.name() == col.name();
|
||||
}); rit != it->second.end()) {
|
||||
const_cast<object::attribute_definition &>(col).change_type(rit->type());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user