summaryrefslogtreecommitdiff
path: root/lib/input
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-07-04 19:20:25 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-07-04 19:20:25 +0100
commit6d61eaff73f1a64e375cc0601d12c41c3abdee8b (patch)
tree4c6036f00c1c813826163f2181b3798ed81cbd2c /lib/input
parentRemember table when it's added (diff)
downloadmygrate-6d61eaff73f1a64e375cc0601d12c41c3abdee8b.tar.bz2
mygrate-6d61eaff73f1a64e375cc0601d12c41c3abdee8b.tar.xz
mygrate-6d61eaff73f1a64e375cc0601d12c41c3abdee8b.zip
Get columns and values from cursors
Diffstat (limited to 'lib/input')
-rw-r--r--lib/input/mysqlRecordSet.cpp12
-rw-r--r--lib/input/mysqlRecordSet.h4
2 files changed, 15 insertions, 1 deletions
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 {