From d6e8b1c5a787641dc63fc50c9b35cc7427a33b65 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 4 Jan 2017 17:54:29 +0000 Subject: Add PQ specific command options to control page size and the use of bulk -v- cursor selects --- libpqpp/unittests/testpq.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libpqpp/unittests') diff --git a/libpqpp/unittests/testpq.cpp b/libpqpp/unittests/testpq.cpp index 15ea022..f7c327f 100644 --- a/libpqpp/unittests/testpq.cpp +++ b/libpqpp/unittests/testpq.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include class StandardMockDatabase : public PQ::Mock { @@ -291,7 +292,8 @@ BOOST_AUTO_TEST_CASE( statementReuse ) BOOST_AUTO_TEST_CASE( bulkSelect ) { auto ro = DB::MockDatabase::openConnectionTo("PQmock"); - auto sel = ro->newSelectCommand("SELECT * FROM test WHERE id > ? --libdbpp:no-cursor"); + PQ::CommandOptions co(0, 35, false); + auto sel = ro->newSelectCommand("SELECT * FROM test WHERE id > ?", &co); sel->bindParamI(0, 1); int totalInt = 0, count = 0; sel->forEachRow([&totalInt, &count](auto i) { @@ -307,7 +309,8 @@ BOOST_AUTO_TEST_CASE( bulkSelect ) BOOST_AUTO_TEST_CASE( insertReturning ) { auto ro = DB::MockDatabase::openConnectionTo("PQmock"); - auto sel = ro->newSelectCommand("INSERT INTO test(id, fl) VALUES(1, 3) RETURNING id + fl --libdbpp:no-cursor"); + PQ::CommandOptions co(0, 35, false); + auto sel = ro->newSelectCommand("INSERT INTO test(id, fl) VALUES(1, 3) RETURNING id + fl", &co); int totalInt = 0, count = 0; sel->forEachRow([&totalInt, &count](auto i) { totalInt += i; -- cgit v1.2.3