summaryrefslogtreecommitdiff
path: root/libpqpp/pq-connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libpqpp/pq-connection.cpp')
-rw-r--r--libpqpp/pq-connection.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/libpqpp/pq-connection.cpp b/libpqpp/pq-connection.cpp
index e189acf..214f211 100644
--- a/libpqpp/pq-connection.cpp
+++ b/libpqpp/pq-connection.cpp
@@ -96,20 +96,20 @@ PQ::Connection::ping() const
}
-DB::SelectCommand *
-PQ::Connection::newSelectCommand(const std::string & sql, const DB::CommandOptions * opts)
+DB::SelectCommandPtr
+PQ::Connection::select(const std::string & sql, const DB::CommandOptions * opts)
{
auto pqco = dynamic_cast<const CommandOptions *>(opts);
if (pqco && !pqco->useCursor) {
- return new BulkSelectCommand(this, sql, pqco, opts);
+ return std::make_shared<BulkSelectCommand>(this, sql, pqco, opts);
}
- return new CursorSelectCommand(this, sql, pqco, opts);
+ return std::make_shared<CursorSelectCommand>(this, sql, pqco, opts);
}
-DB::ModifyCommand *
-PQ::Connection::newModifyCommand(const std::string & sql, const DB::CommandOptions * opts)
+DB::ModifyCommandPtr
+PQ::Connection::modify(const std::string & sql, const DB::CommandOptions * opts)
{
- return new ModifyCommand(this, sql, opts);
+ return std::make_shared<ModifyCommand>(this, sql, opts);
}
bool