From 6c9c161de3f35ff330234e651bec4cfbfaa1cb6b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 4 Jul 2021 12:41:11 +0100 Subject: Push mysqldata at into base class --- lib/input/mysqlRecordSet.cpp | 6 ++++++ lib/input/mysqlRecordSet.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/lib/input/mysqlRecordSet.cpp b/lib/input/mysqlRecordSet.cpp index 1585052..494ce13 100644 --- a/lib/input/mysqlRecordSet.cpp +++ b/lib/input/mysqlRecordSet.cpp @@ -105,6 +105,12 @@ namespace MyGrate::Input { verify(!mysql_stmt_fetch(stmt.get()), "Fetch", stmt.get()); currentRow = row; } + return MySQLData::at(col); + } + + DbValue + MySQLData::at(std::size_t col) const + { if (extras[col]->null) { return nullptr; } diff --git a/lib/input/mysqlRecordSet.h b/lib/input/mysqlRecordSet.h index 0b4a057..d843dfd 100644 --- a/lib/input/mysqlRecordSet.h +++ b/lib/input/mysqlRecordSet.h @@ -21,6 +21,8 @@ namespace MyGrate::Input { std::size_t columns() const; + DbValue at(std::size_t col) const; + StmtPtr stmt; std::vector fields; std::vector extras; -- cgit v1.2.3