has many fetch with join

This commit is contained in:
Sascha Kühl
2025-02-19 14:51:42 +01:00
parent 784f6e768d
commit 8ab8274d93
19 changed files with 264 additions and 52 deletions
@@ -44,6 +44,7 @@ public:
[[nodiscard]] const char *column(size_t index) const override;
utils::result<bool, utils::error> fetch() override;
[[nodiscard]] size_t start_column_index() const override;
void unshift() override;
void read_value(const char *id, size_t index, int8_t &value) override;
void read_value(const char *id, size_t index, int16_t &value) override;
@@ -34,6 +34,12 @@ size_t postgres_result_reader::start_column_index() const {
return 0;
}
void postgres_result_reader::unshift() {
if (row_index_ > 0) {
--row_index_;
}
}
void postgres_result_reader::read_value(const char * /*id*/, const size_t index, int8_t &value) {
if (auto res = utils::to<int8_t>(column(index)); res.is_ok()) {
value = res.value();