summaryrefslogtreecommitdiff
path: root/lib/input/mysqlStmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/input/mysqlStmt.h')
-rw-r--r--lib/input/mysqlStmt.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/input/mysqlStmt.h b/lib/input/mysqlStmt.h
new file mode 100644
index 0000000..a42e0db
--- /dev/null
+++ b/lib/input/mysqlStmt.h
@@ -0,0 +1,29 @@
+#ifndef MYGRATE_INPUT_MYSQLSTMT_H
+#define MYGRATE_INPUT_MYSQLSTMT_H
+
+#include "dbConn.h"
+#include "dbRecordSet.h"
+#include "dbTypes.h"
+#include <cstddef>
+#include <initializer_list>
+#include <memory>
+#include <mysql.h>
+
+namespace MyGrate::Input {
+ using StmtPtr = std::unique_ptr<MYSQL_STMT, decltype(&mysql_stmt_close)>;
+
+ class MySQLPrepStmt : public DbPrepStmt {
+ public:
+ MySQLPrepStmt(const char * const q, MYSQL * c);
+ void execute(const std::initializer_list<DbValue> & vs) override;
+
+ std::size_t rows() const override;
+
+ RecordSetPtr recordSet() override;
+
+ private:
+ StmtPtr stmt;
+ };
+}
+
+#endif