2020-11-28 14:18:58 +01:00
|
|
|
#ifndef PGSQL_CONNECTION
|
|
|
|
#define PGSQL_CONNECTION
|
|
|
|
|
2020-12-01 14:53:32 +01:00
|
|
|
#include "core/database.h"
|
|
|
|
|
2020-11-28 14:18:58 +01:00
|
|
|
//Brynet has it aswell, and because of using namespace it is defined here aswell
|
|
|
|
//later this will be fixed better
|
|
|
|
//#ifdef IS_NUM
|
|
|
|
//#undef IS_NUM
|
|
|
|
//#endif
|
|
|
|
|
|
|
|
#include <libpq-fe.h>
|
|
|
|
|
2020-12-01 14:56:05 +01:00
|
|
|
class PGSQLDatabase : public Database {
|
2020-12-01 14:53:32 +01:00
|
|
|
public:
|
2020-12-01 15:28:59 +01:00
|
|
|
static Database *_creation_func();
|
|
|
|
static void _register();
|
|
|
|
static void _unregister();
|
2020-12-01 14:53:32 +01:00
|
|
|
|
2020-12-01 15:28:59 +01:00
|
|
|
PGSQLDatabase() :
|
|
|
|
Database() {
|
2020-12-01 14:53:32 +01:00
|
|
|
conn = PQconnectStart("");
|
|
|
|
}
|
2020-12-01 14:56:05 +01:00
|
|
|
~PGSQLDatabase() {
|
2020-12-01 14:53:32 +01:00
|
|
|
PQfinish(conn);
|
|
|
|
}
|
|
|
|
|
|
|
|
PGconn *conn;
|
2020-11-28 14:18:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
//#undef IS_NUM
|
|
|
|
|
|
|
|
#endif
|