fixed core- and orm-tests. postgres-tests needs some work

This commit is contained in:
Sascha Kühl
2025-11-20 15:35:40 +01:00
parent 95c555d03a
commit 3f3773dc71
17 changed files with 170 additions and 139 deletions
+1 -1
View File
@@ -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 ) {
+4 -2
View File
@@ -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());
}
}