12 #include "common/datatypes/Value.h"
13 #include "common/graph/Response.h"
16 class ScopedEventBaseThread;
24 class GraphServiceAsyncClient;
31 using ExecuteJsonCallback = std::function<void(std::string &&)>;
42 clientLoopThread_ = c.clientLoopThread_;
43 c.clientLoopThread_ =
nullptr;
50 bool open(
const std::string &address,
54 const std::string &CAPath);
56 AuthResponse authenticate(
const std::string &user,
const std::string &password);
60 void asyncExecute(int64_t sessionId,
const std::string &stmt, ExecuteCallback cb);
63 const std::string &stmt,
64 const std::unordered_map<std::string, Value> ¶meters);
66 void asyncExecuteWithParameter(int64_t sessionId,
67 const std::string &stmt,
68 const std::unordered_map<std::string, Value> ¶meters,
71 std::string executeJson(int64_t sessionId,
const std::string &stmt);
73 void asyncExecuteJson(int64_t sessionId,
const std::string &stmt, ExecuteJsonCallback cb);
75 std::string executeJsonWithParameter(int64_t sessionId,
76 const std::string &stmt,
77 const std::unordered_map<std::string, Value> ¶meters);
79 void asyncExecuteJsonWithParameter(int64_t sessionId,
80 const std::string &stmt,
81 const std::unordered_map<std::string, Value> ¶meters,
82 ExecuteJsonCallback cb);
92 void signout(int64_t sessionId);
95 graph::cpp2::GraphServiceAsyncClient *client_{
nullptr};
96 folly::ScopedEventBaseThread *clientLoopThread_{
nullptr};