From f86b8d2e23339e27d416145ad7b660d66267e151 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 9 Apr 2018 12:06:17 +0100 Subject: C++17 Updates code largely in-keeping with updates to be C++17 in line with libadhocutil and libdbpp. --- libpqpp/pq-mock.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libpqpp/pq-mock.cpp') diff --git a/libpqpp/pq-mock.cpp b/libpqpp/pq-mock.cpp index f2090a4..6cc114f 100644 --- a/libpqpp/pq-mock.cpp +++ b/libpqpp/pq-mock.cpp @@ -19,17 +19,17 @@ Mock::Mock(const std::string & masterdb, const std::string & name, const std::ve } AdHocFormatter(MockConnStr, "user=postgres dbname=%?"); -PQ::Connection * +DB::ConnectionPtr Mock::openConnection() const { - return new Connection(MockConnStr::get(boost::algorithm::to_lower_copy(testDbName))); + return std::make_shared(MockConnStr::get(boost::algorithm::to_lower_copy(testDbName))); } AdHocFormatter(MockSetUnlogged, "ALTER TABLE %?.%? SET UNLOGGED"); void Mock::SetTablesToUnlogged() const { - auto c = ConnectionPtr(openConnection()); + auto c = std::static_pointer_cast(openConnection()); if (c->serverVersion() < 90500) return; auto s = c->select(R"SQL( SELECT n.nspname, c.relname -- cgit v1.2.3