diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-05-31 13:18:17 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-05-31 13:18:17 +0100 |
commit | 63b2ca0dbdae190941d60a55c9cff99d4a75a0e1 (patch) | |
tree | d3766bcbc98fb5fb0fb2d8dddf2f194bedcb0325 /lib/dbConn.h | |
parent | Map std::size_t to a sensible header (diff) | |
download | mygrate-63b2ca0dbdae190941d60a55c9cff99d4a75a0e1.tar.bz2 mygrate-63b2ca0dbdae190941d60a55c9cff99d4a75a0e1.tar.xz mygrate-63b2ca0dbdae190941d60a55c9cff99d4a75a0e1.zip |
Initial commit of prepstmt, selects, record sets
This is full of holes, but all the basics are covered.
Diffstat (limited to 'lib/dbConn.h')
-rw-r--r-- | lib/dbConn.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/dbConn.h b/lib/dbConn.h index 26b9a64..e4b056c 100644 --- a/lib/dbConn.h +++ b/lib/dbConn.h @@ -1,13 +1,27 @@ #ifndef MYGRATE_DBCONN_H #define MYGRATE_DBCONN_H +#include <dbRecordSet.h> #include <dbTypes.h> #include <initializer_list> namespace MyGrate { + class DbPrepStmt { + public: + virtual ~DbPrepStmt() = default; + virtual void execute(const std::initializer_list<DbValue> &) = 0; + virtual std::size_t rows() const = 0; + virtual RecordSetPtr recordSet() = 0; + }; + using DbPrepStmtPtr = std::unique_ptr<DbPrepStmt>; + class DbConn { + public: + virtual ~DbConn() = default; virtual void query(const char * const) = 0; virtual void query(const char * const, const std::initializer_list<DbValue> &) = 0; + + virtual DbPrepStmtPtr prepare(const char * const, std::size_t nParams) = 0; }; } |