-
Notifications
You must be signed in to change notification settings - Fork 46
/
pdo_pgsql_connection.h
58 lines (40 loc) · 1.59 KB
/
pdo_pgsql_connection.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef incl_HPHP_PDO_PGSQL_CONNECTION_H_
#define incl_HPHP_PDO_PGSQL_CONNECTION_H_
#include "hphp/runtime/ext/pdo/pdo_driver.h"
#include "pq.h"
#define PHP_PDO_PGSQL_CONNECTION_FAILURE_SQLSTATE "08006"
namespace HPHP {
class PDOPgSqlStatement;
class PDOPgSqlConnection : public PDOConnection {
friend class PDOPgSqlStatement;
public:
PDOPgSqlConnection();
virtual ~PDOPgSqlConnection();
virtual bool create(const Array &options);
virtual int64_t doer(const String& sql);
virtual bool closer();
virtual bool begin();
virtual bool commit();
virtual bool rollback();
virtual bool checkLiveness();
virtual bool quoter(const String& input, String "ed, PDOParamType paramtype);
virtual bool support(SupportedMethod method);
virtual String lastId(const char *name);
virtual int getAttribute(int64_t attr, Variant &value);
virtual bool setAttribute(int64_t attr, const Variant &value);
virtual bool fetchErr(PDOStatement *stmt, Array &info);
String pgsqlLOBCreate();
bool preparer(const String& sql, sp_PDOStatement *stmt, const Variant& options) override;
private:
PQ::Connection* m_server;
Oid pgoid;
ExecStatusType m_lastExec;
std::string err_msg;
bool m_emulate_prepare;
const char* sqlstate(PQ::Result& result);
void handleError(PDOPgSqlStatement* stmt, const char* sqlState, const char* msg);
bool transactionCommand(const char* command);
void testConnection();
};
}
#endif