added timestamp code, support columns for group by and order by and tested load has-many eager code

This commit is contained in:
2026-01-08 15:14:31 +01:00
parent 0bf945cd13
commit 930b9d1aa4
34 changed files with 853 additions and 846 deletions
@@ -2,6 +2,7 @@
#include "matador/utils/convert.hpp"
#include "matador/utils/value.hpp"
#include "matador/utils/string.hpp"
namespace matador::backends::postgres {
postgres_result_reader::postgres_result_reader(PGresult *result)
@@ -104,18 +105,25 @@ 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, utils::date_type_t &value) {
if (const auto val = column(index); strlen(val) > 0) {
// value = time::parse(val, "%Y-%m-%d %T.%f");
if (const auto res = utils::to<utils::date_type_t>(std::string(val)); res.is_ok()) {
value = res.value();
}
}
}
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, utils::time_type_t &value) {
if (const auto val = column(index); strlen(val) > 0) {
// value.set(val, matador::utils::date_format::ISO8601);
if (const auto res = utils::to<utils::time_type_t>(std::string(val)); res.is_ok()) {
value = res.value();
}
}
}
void postgres_result_reader::read_value(const char * /*id*/, size_t index, utils::timestamp_type_t &value) {
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, utils::timestamp_type_t &value) {
if (const auto val = column(index); strlen(val) > 0) {
if (const auto res = utils::to<utils::timestamp_type_t>(std::string(val)); res.is_ok()) {
value = res.value();
}
}
}