diff options
-rw-r--r-- | lib/dbRecordSet.h | 2 | ||||
-rw-r--r-- | lib/input/mysqlRecordSet.cpp | 12 | ||||
-rw-r--r-- | lib/input/mysqlRecordSet.h | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/lib/dbRecordSet.h b/lib/dbRecordSet.h index a217f12..3bea950 100644 --- a/lib/dbRecordSet.h +++ b/lib/dbRecordSet.h @@ -55,6 +55,8 @@ namespace MyGrate { virtual ~Cursor() = default; virtual bool fetch() = 0; + virtual std::size_t columns() const = 0; + virtual DbValue at(std::size_t) const = 0; }; using CursorPtr = std::unique_ptr<Cursor>; } diff --git a/lib/input/mysqlRecordSet.cpp b/lib/input/mysqlRecordSet.cpp index 5fbbfe9..f5d2385 100644 --- a/lib/input/mysqlRecordSet.cpp +++ b/lib/input/mysqlRecordSet.cpp @@ -128,4 +128,16 @@ namespace MyGrate::Input { } throw MySQLErr("Fetch", stmt.get()); } + + std::size_t + MySQLCursor::columns() const + { + return MySQLData::columns(); + } + + DbValue + MySQLCursor::at(std::size_t col) const + { + return MySQLData::at(col); + } } diff --git a/lib/input/mysqlRecordSet.h b/lib/input/mysqlRecordSet.h index 0e3a96f..d07978a 100644 --- a/lib/input/mysqlRecordSet.h +++ b/lib/input/mysqlRecordSet.h @@ -32,7 +32,9 @@ namespace MyGrate::Input { public: using MySQLData::MySQLData; - bool fetch(); + bool fetch() override; + std::size_t columns() const override; + DbValue at(std::size_t col) const override; }; class MySQLRecordSet : public MySQLData, public RecordSet { |