Remove obsolete pointer indirection, fix warnings and a leak

Leak: The sqlite3 connection handle destructor was
accidentally turned into a default constructor during the
migration of repositories.

Replaced the sqlite3 raw pointer with a unique_ptr to prevent
this kind of accident.
This commit is contained in:
Roland Bock
2022-01-10 07:40:36 +01:00
parent 23ae65dd67
commit d6aef0fa9b
6 changed files with 73 additions and 72 deletions

View File

@@ -38,8 +38,6 @@
#include <iostream>
#include <vector>
SQLPP_ALIAS_PROVIDER(left)
namespace sql = sqlpp::sqlite3;
const auto tab = TabSample{};
@@ -143,8 +141,8 @@ int Select(int, char*[])
auto tx = start_transaction(db);
for (const auto& row : db(select(all_of(tab), select(max(tab.alpha)).from(tab)).from(tab).unconditionally()))
{
int x = row.alpha;
int a = row.max;
const int64_t x = row.alpha;
const int64_t a = row.max;
std::cout << ">>>" << x << ", " << a << std::endl;
}
for (const auto& row :
@@ -161,8 +159,8 @@ int Select(int, char*[])
for (const auto& row : db(select(all_of(tab), select(trim(tab.beta)).from(tab)).from(tab).unconditionally()))
{
int x = row.alpha;
std::string a = row.trim;
const int64_t x = row.alpha;
const std::string a = row.trim;
std::cout << ">>>" << x << ", " << a << std::endl;
}