-
Notifications
You must be signed in to change notification settings - Fork 2
/
db-json.h
81 lines (67 loc) · 1.4 KB
/
db-json.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef DB_JSON_H
#define DB_JSON_H 1
#include "db-intf.h"
/**
*/
class DatabaseJSON : public DatabaseIntf
{
private:
std::string url; // POST
std::string login; // remember user credentials
std::string password; // remember user credentials
std::string authorizationUrl; // POST
std::string auth; // session auth token
public:
DatabaseJSON();
~DatabaseJSON();
virtual int open(
const std::string &connection,
const std::string &login,
const std::string &password,
const std::string &auth,
int port
) override;
virtual int close() override;
virtual int exec(
const std::string &statement
) override;
virtual int select(
std::vector<std::vector<std::string>> &retval,
const std::string &statement
) override;
std::string errMessage;
//
// cursor
//
virtual int cursorOpen(
void **retStmt,
std::string &statement
) override;
virtual int cursorBindText(
void *stmt,
int position1,
const std::string &value
) override;
virtual int cursorColumnCount(
void *stmt
) override;
virtual std::string cursorColumnName(
void *stmt,
int column0
) override;
virtual std::string cursorColumnText(
void *stmt,
int column0
) override;
virtual DB_FIELD_TYPE cursorColumnType(
void *stmt,
int column0
) override;
virtual bool cursorNext(
void *stmt
) override;
virtual int cursorClose(
void *stmt
) override;
};
#endif