From 25a8dfa292119153cdda8c52fa18ee322aaa8af3 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Fri, 6 Aug 2021 10:14:24 +0200 Subject: [PATCH] Add dynamic_insert_into test. --- tests/mysql/usage/SampleTest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/mysql/usage/SampleTest.cpp b/tests/mysql/usage/SampleTest.cpp index 72e8dd3d..ba99d6de 100644 --- a/tests/mysql/usage/SampleTest.cpp +++ b/tests/mysql/usage/SampleTest.cpp @@ -111,6 +111,11 @@ int main() db(update(tab).set(tab.gamma = false).where(tab.alpha.in(sqlpp::value_list(std::vector{1, 2, 3, 4})))); db(update(tab).set(tab.gamma = true).where(tab.alpha.in(1))); + // dynamic insert + auto dynin = dynamic_insert_into(db, tab).dynamic_set(tab.gamma = true); + dynin.insert_list.add(tab.beta = "cheesecake"); + db(dynin); + // remove db(remove_from(tab).where(tab.alpha == tab.alpha + 3));