summaryrefslogtreecommitdiff
path: root/test/test-mysql.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-06-03 00:17:28 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-06-03 00:17:39 +0100
commit6e726340e23a97480b17065a633c36a9ba53cf14 (patch)
treecd9f161a542f85e5cae9119e43c870651431d0ca /test/test-mysql.cpp
parentAdd event source ptr typedef (diff)
downloadmygrate-6e726340e23a97480b17065a633c36a9ba53cf14.tar.bz2
mygrate-6e726340e23a97480b17065a633c36a9ba53cf14.tar.xz
mygrate-6e726340e23a97480b17065a633c36a9ba53cf14.zip
Determine parameter mode at point of call by DB type property
It's still constexpr, so that's all good.
Diffstat (limited to 'test/test-mysql.cpp')
-rw-r--r--test/test-mysql.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test-mysql.cpp b/test/test-mysql.cpp
index f5281a9..493ec02 100644
--- a/test/test-mysql.cpp
+++ b/test/test-mysql.cpp
@@ -4,6 +4,7 @@
#include <cstddef>
#include <cstdint>
#include <cstdlib>
+#include <dbConn.h>
#include <dbRecordSet.h>
#include <dbStmt.h>
#include <dbTypes.h>
@@ -42,13 +43,13 @@ BOOST_AUTO_TEST_CASE(simple)
using SomeSelect = MyGrate::DbStmt<"SELECT * FROM foo">;
using SomeShow = MyGrate::DbStmt<"SHOW MASTER STATUS">;
-using SomeUpdate = MyGrate::DbStmt<"UPDATE foo SET blah = ? WHERE bar = ?", MyGrate::ParamMode::QMark>;
+using SomeUpdate = MyGrate::DbStmt<"UPDATE foo SET blah = ? WHERE bar = ?">;
static_assert(std::is_same_v<SomeSelect::Return, MyGrate::RecordSetPtr>);
static_assert(std::is_same_v<SomeShow::Return, MyGrate::RecordSetPtr>);
static_assert(std::is_same_v<SomeUpdate::Return, std::size_t>);
-static_assert(SomeShow::paramCount == 0);
-static_assert(SomeUpdate::paramCount == 2);
+static_assert(SomeShow::paramCount(MyGrate::ParamMode::QMark) == 0);
+static_assert(SomeUpdate::paramCount(MyGrate::ParamMode::QMark) == 2);
BOOST_AUTO_TEST_CASE(stmt)
{