An asynchronous PostgreSQL client using libpq and a network Proactor.
More...
#include <PostgresClient.hpp>
An asynchronous PostgreSQL client using libpq and a network Proactor.
◆ PostgresClient()
| database::PostgresClient::PostgresClient |
( |
network::Proactor * |
proactor, |
|
|
const std::string & |
conninfo |
|
) |
| |
Constructs a new PostgresClient.
- Parameters
-
| proactor | The network Proactor to use for async events. |
| conninfo | The connection string for the PostgreSQL database. |
◆ ~PostgresClient()
| database::PostgresClient::~PostgresClient |
( |
| ) |
|
◆ connect()
| void database::PostgresClient::connect |
( |
std::function< void(bool success)> |
callback | ) |
|
Connects to the PostgreSQL database asynchronously.
- Parameters
-
| callback | A callback invoked with a boolean indicating success or failure. |
◆ query()
| void database::PostgresClient::query |
( |
const std::string & |
sql, |
|
|
std::function< void(const ResultSet &res)> |
callback |
|
) |
| |
Executes a query asynchronously.
- Parameters
-
| sql | The SQL query string. |
| callback | A callback invoked with the query result upon completion. |
The documentation for this class was generated from the following files: