31 #ifndef EXASOCKETS_EXASOCKETS_H
32 #define EXASOCKETS_EXASOCKETS_H
34 #include <websockets/websockets.h>
36 #include "exaResultSet.h"
38 #include <rapidjson/document.h>
39 #include <rapidjson/writer.h>
40 #include <rapidjson/stringbuffer.h>
41 #include <rapidjson/allocators.h>
43 #include <openssl/pem.h>
44 #include <openssl/rsa.h>
45 #include <openssl/bio.h>
46 #include <openssl/err.h>
57 #define HOST_NAME_MAX 16
60 #define DRV_NAME "EXASOCKETS 0.1"
61 #define FETCH_BYTES 2 * 1048576//2097152//10485760
64 const char * what()
const throw () {
65 return "Error: failed to create RSA bio";
70 const char * what()
const throw () {
71 return "Error: failed to create RSA";
94 const char *clientName,
98 bool autocommit =
true,
99 bool use_compression =
false,
100 uint64_t sessionId = 0,
106 static int StringToExaDatatype(
const char *str);
108 static char *ExaDatatypeToString(
const int type);
116 int disconnect(
bool throw_message =
true);
118 int update_session_attributes();
142 uint64_t numBytes = 10485760);
158 virtual int close_result_set(
int handle);
169 virtual int create_prepared_insert_int(
char *sql);
187 const char *databaseName()
const;
188 const char *identifierQuoteString()
const;
189 int maxDataMessageSize()
const;
190 int maxIdentifierLength()
const;
191 int maxVarcharLength()
const;
192 const char *productName()
const;
193 int protocolVersion()
const;
194 const char *releaseVersion()
const;
195 uint64_t session_id()
const;
196 const char *timezone()
const;
197 const char *timeZoneBehaviour()
const;
198 bool isStatus()
const;
200 rapidjson::Document resultSet;
201 rapidjson::Value *data;
202 bool json_debug_output =
false;
206 static void
append_data_from_Rapid_JSON_Document(
exaResultSetHandler
*rs,
const rapidjson::Value &JSONdata);
209
create_exaResultSetHandler_from_RapidJSON_Document(
const rapidjson::Value &JSONresultSet,
int handle = -1);
211 Websockets_connection *ws_con =
nullptr;
212 rapidjson::Document d;
213 std::stringstream tfile;
214 char *logfile =
nullptr;
216 const char *c_databaseName;
217 const char *c_identifierQuoteString;
218 int c_maxDataMessageSize;
219 int c_maxIdentifierLength;
220 int c_maxVarcharLength;
221 const char *c_productName;
222 int c_protocolVersion;
223 const char *c_releaseVersion;
224 uint64_t c_session_id;
225 const char *c_timezone;
226 const char *c_timeZoneBehaviour;
230 int ws_send_data(
const char *data,
int len = -1,
int type = 1);
232 std::string ws_receive_data();
236 #endif //EXASOCKETS_EXASOCKETS_H
Definition: exasockets.h:63
Definition: exaResultSet.h:205
Definition: exasockets.h:69
Definition: exasockets.h:75