2021-12-29 16:00:32 +01:00
|
|
|
#include <string>
|
|
|
|
#include <iostream>
|
|
|
|
#include <libpq-fe.h>
|
|
|
|
#include <vector>
|
2021-12-15 21:59:17 +01:00
|
|
|
|
|
|
|
#ifndef DATABASE_H
|
|
|
|
#define DATABASE_H
|
|
|
|
|
|
|
|
class Database
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2021-12-29 16:00:32 +01:00
|
|
|
PGconn *dbconn;
|
2021-12-15 21:59:17 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
Database();
|
2021-12-28 15:32:39 +01:00
|
|
|
|
2021-12-29 16:00:32 +01:00
|
|
|
void execute(std::string cmd);
|
|
|
|
|
|
|
|
PGresult* fetch(std::string cmd);
|
2021-12-28 15:32:39 +01:00
|
|
|
|
|
|
|
void disconnect();
|
2021-12-15 21:59:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* DATABASE_H */
|