![]() |
AnCH Framework
0.1
Another C++ Hack Framework
|
PostgreSQL connection. More...
#include <postgresqlConnection.hpp>
Public Member Functions | |
PostgreSQLConnection (const std::string &host, const std::string &user, const std::string &password, const std::string &database, int port, const std::string &app="") throw (SqlException) | |
PostgreSQLConnection (const std::string &connStr) throw (SqlException) | |
PostgreSQLConnection (const SqlConnectionConfiguration &config) throw (SqlException) | |
PostgreSQLConnection (const PostgreSQLConnection &)=delete | |
~PostgreSQLConnection () | |
![]() | |
Connection () throw (SqlException) | |
Connection (const Connection &)=delete | |
virtual | ~Connection () |
void | commit () throw (SqlException) |
void | rollback () throw (SqlException) |
void | setAutoCommit (bool autoCommit) throw (SqlException) |
ResultSet * | query (const std::string &query) throw (SqlException) |
void | queryMapRow (const std::string &sqlQuery, std::function< void(ResultSet &)> rowMapper) throw (SqlException) |
void | queryExtract (const std::string &sqlQuery, std::function< void(ResultSet &)> resExtractor) throw (SqlException) |
uint64_t | update (const std::string &query) throw (SqlException) |
bool | isAutoCommit () const |
bool | isValid () const |
Protected Member Functions | |
virtual ResultSet * | executeQuery (const std::string &query) override throw (SqlException) |
virtual uint64_t | executeUpdate (const std::string &query) override throw (SqlException) |
virtual void | sendCommit () override throw (SqlException) |
virtual void | sendRollback () override throw (SqlException) |
virtual void | toggleAutoCommit (bool autoCommit) override throw (SqlException) |
![]() | |
void | setValid (bool valid) |
Additional Inherited Members | |
![]() | |
bool | _autoCommit |
bool | _valid |
PostgreSQL connection.
SQL connection implementation through PostgreSQL native library
PostgreSQLConnection::PostgreSQLConnection | ( | const std::string & | host, |
const std::string & | user, | ||
const std::string & | password, | ||
const std::string & | database, | ||
int | port, | ||
const std::string & | app = "" |
||
) | |||
throw | ( | SqlException | |
) |
PostgreSQLConnection constructor
host | the PostgreSQL server hostname |
user | the datase user login |
password | the database login password |
database | the database name |
port | the database access port |
app | the application name |
SqlException | fail to create connection |
PostgreSQLConnection::PostgreSQLConnection | ( | const std::string & | connStr | ) | |
throw | ( | SqlException | |||
) |
PostgreSQLConnection constructor
connStr | the PostgreSQL connection string |
SqlException | fail to create connection |
PostgreSQLConnection::PostgreSQLConnection | ( | const SqlConnectionConfiguration & | config | ) | |
throw | ( | SqlException | |||
) |
PostgreSQLConnection constructor
config | the PostgreSQL database configuration |
SqlException | fail to create connection |
|
delete |
Prohibit PostgreSQLConnection copy constructor
|
noexcept |
PostgreSQLConnection destructor
|
overrideprotectedvirtual |
Execute SQL select query
query | the SQL query to execute |
SqlException | any error |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Execute SQL update query
query | the SQL query to execute |
SqlException | any error |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Send commit to database server
SqlException | fail to commit transaction |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Send rollback to database server
SqlException | fail to rollback transaction |
Implements anch::sql::Connection.
|
overrideprotectedvirtual |
Send auto commit status modification to server
autoCommit | the status to send |
SqlException | any error |
Implements anch::sql::Connection.