-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
72 lines (59 loc) · 2.48 KB
/
README
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
QQ: 2022998727 wechart: kwg_romalin
Modern, asynchronous and synchronous, and wicked fast C++1y cluster client for Postgres-XL[Build Status] (https://C++17)
pgStorage is a C++ interface to the postgres distribute store that makes it easy to write applications that are both elegant and high-performance. Communication should be a means to an end, not something we spend a lot of time worrying about. pgStorage takes care of the details so you can move on to the interesting part of your project.
Features:
Expressive asynchronous and synchronous function,
customized by return value
class methods, bind expressions, or any std::function
Thread-safe - use one client in multiple threads or multiple clients in one
Automatic queue, even for synchronous calls from separate threads
Low-level access when needed
Accessible and robust error handling
Configurable logging level and output to any ostream via glog to open
Full SQL support for postgres-xl fixed.
Fast - developed for robotics applications
100% clean Valgrind reports
There is no dependency on Boost or any other libraries.
void TestTransaction() {
req_t req; res_t res;
req.table = "compa";
req.method = "select";
req.type=2;
req.statement = R"(select * from compa limit 10)";
gPgCluser.TExec(res, req);
cout<<res.result<<endl;
}
void TestNonTransaction() {
req_t req; res_t res;
req.table = "compa";
req.method = "select";
req.type=1;
req.statement = R"(select * from compa limit 10)";
req.uuid=get_uuid();
gPgCluser.NTExec(res, req);
cout<<res.result<<endl;
}
void TestInsert() {
req_t req; res_t res;
req.table = "compa2";
req.method = "insert";
req.type=2;
req.statement = R"(INSERT INTO compa2(NAME,AGE,ADDRESS,SALARY) VALUES('Mark', 25, 'Rich-Mond ', 65000.00 );)";
req.uuid=get_uuid();
gPgAPool.enqueue(std::unique_ptr<ComplexPostgresRequest>(new ComplexPostgresRequest(req)));
}
int main(int argc, char* argv[])
{
TestNonTransaction();
TestTransaction();
TestInsert();
return 0;
}
Contact GitHub API Training Shop Blog About
//压力测试
curl -i -X POST -H "'Content-type':'application/x-www-form-urlencoded', 'charset':'utf-8', 'Accept': 'text/plain'" -d '{"table":"companyt101","method":"select","type":2,"statement":"select * from compa;","uuid":"a3879c8e-0499-11e7-8b3e-0242ac110002"} ' 192.168.2.46:11000/v2
{
ln -sf jsondata postd
ab -n 20000 -kc 500 -p postd -T 'Accept: application/json' http://192.168.2.46:11000/v2
}
./bin/Release/ethiSpark -n 1000000 -c 100 -t 5 -k http://192.168.2.46:11000/v2