mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 21:04:15 +08:00
Fix warnings and minor issues
This commit is contained in:
parent
d15a6ee1a3
commit
50c6b29920
@ -44,7 +44,7 @@ namespace sqlpp
|
||||
struct automatic
|
||||
{
|
||||
template<typename Connection>
|
||||
bool validate(Connection* connection)
|
||||
void validate(Connection* connection)
|
||||
{
|
||||
if (!connection->is_valid())
|
||||
{
|
||||
@ -52,7 +52,7 @@ namespace sqlpp
|
||||
{
|
||||
connection->reconnect();
|
||||
}
|
||||
catch (const sqlpp::exception& e)
|
||||
catch (const sqlpp::exception&)
|
||||
{
|
||||
throw sqlpp::exception("Failed to reconnect to database.");
|
||||
}
|
||||
@ -191,7 +191,7 @@ namespace sqlpp
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch (const sqlpp::exception& e)
|
||||
catch (const sqlpp::exception&)
|
||||
{
|
||||
throw sqlpp::exception("Failed to retrieve a valid connection.");
|
||||
}
|
||||
@ -201,7 +201,7 @@ namespace sqlpp
|
||||
{
|
||||
return pool_connection<Connection_config, Connection_validator, Connection>(std::move(std::make_unique<Connection>(config)), this);
|
||||
}
|
||||
catch (const sqlpp::exception& e)
|
||||
catch (const sqlpp::exception&)
|
||||
{
|
||||
throw sqlpp::exception("Failed to spawn a new connection.");
|
||||
}
|
||||
|
@ -45,7 +45,10 @@ namespace sqlpp
|
||||
|
||||
~pool_connection()
|
||||
{
|
||||
origin->free_connection(_impl);
|
||||
if (_impl.get())
|
||||
{
|
||||
origin->free_connection(_impl);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
@ -81,7 +84,10 @@ namespace sqlpp
|
||||
pool_connection(pool_connection&& other)
|
||||
: _impl(std::move(other._impl)), origin(other.origin) {}
|
||||
pool_connection& operator=(const pool_connection&) = delete;
|
||||
pool_connection& operator=(pool_connection&&) = delete;
|
||||
pool_connection& operator=(pool_connection&& other)
|
||||
{
|
||||
_impl(std::move(other._impl)), origin(other.origin);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user