]> git.stg.codes - stg.git/blob - projects/stargazer/plugins/store/db/pg_driver.h
Correcting return in method GetParamValue and cycle in methods OnConnect and OnDisconnect
[stg.git] / projects / stargazer / plugins / store / db / pg_driver.h
1 #ifndef __PG_DRIVER_H__
2 #define __PG_DRIVER_H__
3
4 #include <libpq-fe.h>
5
6 #include "base_db.h"
7
8 extern "C" BASE_DB * CreateDriver();
9 extern "C" void DestroyDriver(BASE_DB *);
10
11 class PG_DRIVER : public BASE_DB {
12 public:
13     virtual ~PG_DRIVER();
14
15     virtual bool Connect();
16     virtual bool Disconnect();
17     virtual bool Query(const std::string &);
18     virtual bool Start();
19     virtual bool Commit();
20     virtual bool Rollback();
21
22     virtual BASE_DB::TUPLES GetResult() const;
23     virtual BASE_DB::TUPLE GetTuple(int n = 0) const;
24
25 private:
26     PGconn * conn;
27     PGresult * result;
28     COLUMNS cols;
29 };
30
31 #endif