summaryrefslogtreecommitdiff
path: root/lib/input/mysqlConn.h
blob: db30ff0b38ddd428dc9e2cd9784f35506fc23156 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef MYGRATE_INPUT_MYSQLCONN_H
#define MYGRATE_INPUT_MYSQLCONN_H

#include <cstddef>
#include <dbConn.h>
#include <initializer_list>
#include <mysql.h>

namespace MyGrate {
	class DbValue;
}
namespace MyGrate::Input {
	class MySQLConn : public MYSQL, public DbConn {
	public:
		static constexpr auto paramMode {ParamMode::QMark};

		MySQLConn(const char * const host, const char * const user, const char * const pass, unsigned short port);
		~MySQLConn();

		void query(const char * const) override;
		void query(const char * const q, const std::initializer_list<DbValue> &) override;

		DbPrepStmtPtr prepare(const char * const, std::size_t) override;
	};
}

#endif