added belongs to many eager test loading via sql join (progress)

This commit is contained in:
2025-02-17 22:16:03 +01:00
parent 5109659882
commit 901d9c071a
5 changed files with 64 additions and 15 deletions
@@ -89,11 +89,6 @@ utils::result<std::unique_ptr<sql::query_result_impl>, utils::error> postgres_co
return utils::failure(make_error(sql::error_code::FETCH_FAILED, res, conn_, "Failed to fetch", context.sql));
}
// const auto is_unknown = std::all_of( context.prototype.begin(), context.prototype.end(), [](const object::attribute_definition &a) {return a.is_null();} );
// if (!is_unknown) {
// return utils::ok(std::make_unique<sql::query_result_impl>(std::make_unique<postgres_result_reader>(res), context.prototype));
// }
std::vector<object::attribute_definition> prototype = context.prototype;
const int num_col = PQnfields(res);
@@ -100,13 +100,13 @@ void postgres_result_reader::read_value(const char * /*id*/, const size_t index,
}
}
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, time &value) {
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, time &/*value*/) {
// if (const auto val = column(index); strlen(val) > 0) {
// value = time::parse(val, "%Y-%m-%d %T.%f");
// }
}
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, date &value) {
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, date &/*value*/) {
// if (const auto val = column(index); strlen(val) > 0) {
// value.set(val, matador::utils::date_format::ISO8601);
// }