mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-05-02 08:59:37 -05:00
Add connection methods is_connected() and ping_server() (#528)
* Replace connection handle method check_connection() with is_connected() and ping_server() * When a connections is fetched from a pool perform a validity check which can be one of none, passive or ping. * Add the methods is_connected() and ping_server() to the connection template class. * Remove unused #include and add mising #include. * Add tests for the connection methods is_connected() and ping_server().
This commit is contained in:
@@ -30,8 +30,8 @@ set(test_files
|
||||
Basic.cpp
|
||||
BasicConstConfig.cpp
|
||||
Blob.cpp
|
||||
Connection.cpp
|
||||
ConnectionPool.cpp
|
||||
Constructor.cpp
|
||||
Date.cpp
|
||||
DateTime.cpp
|
||||
Exceptions.cpp
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Serge Robyns
|
||||
* Copyright (c) 2023, Vesselin Atanasov
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
@@ -23,13 +24,17 @@
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "../../include/ConnectionTests.h"
|
||||
#include "make_test_connection.h"
|
||||
|
||||
#include <sqlpp11/postgresql/connection.h>
|
||||
#include <sqlpp11/sqlpp11.h>
|
||||
|
||||
namespace sql = sqlpp::postgresql;
|
||||
|
||||
int Constructor(int, char*[])
|
||||
int Connection(int, char*[])
|
||||
{
|
||||
sql::connection db;
|
||||
namespace sql = sqlpp::postgresql;
|
||||
namespace test = sqlpp::test;
|
||||
|
||||
test::test_normal_connection<sql::connection>(sql::make_test_config());
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user