|
EXASockets
0.9
Interface to the EXASOL DB via JSON over Websockets protocol
|
Public Member Functions | |
| exasockets_connection (const char *server, uint16_t port, const char *clientName, const char *username, const char *password, int pwd_len, bool autocommit=true, bool use_compression=false, uint64_t sessionId=0, bool debug=false) | |
| Establishes a connection to EXASOL and returns an exasockets_connection
object. More... |
|
| int | disconnect (bool throw_message=true) |
| Disconnect from EXASOL DB. More... |
|
| int | update_session_attributes () |
| virtual exaResultSetHandler * | exec_sql (char *sql) |
| Sends an SQL statement to EXASOL and fetches the response. More... |
|
| int64_t | fetch (exaResultSetHandler *rs, uint64_t numRows=10000, uint64_t startPosition=1, uint64_t numBytes=10485760) |
| Fetches a result set. More... |
|
| virtual int | close_result_set (exaResultSetHandler &rs) |
| Closes a result set. More... |
|
| virtual int | close_result_set (int handle) |
| Closes a result set. More... |
|
| virtual exaResultSetHandler * | create_prepared_insert (char *sql) |
| Creates a prepared statement. More... |
|
| virtual int | create_prepared_insert_int (char *sql) |
| virtual void | exec_prepared_insert (exaResultSetHandler &rs) |
| Executes a previously prepared statement. More... |
|
| virtual int | close_prepared (exaResultSetHandler &rs) |
| Closes a prepared statement. More... |
|
| const char * | databaseName () const |
| const char * | identifierQuoteString () const |
| int | maxDataMessageSize () const |
| int | maxIdentifierLength () const |
| int | maxVarcharLength () const |
| const char * | productName () const |
| int | protocolVersion () const |
| const char * | releaseVersion () const |
| uint64_t | session_id () const |
| const char * | timezone () const |
| const char * | timeZoneBehaviour () const |
| bool | isStatus () const |
Static Public Member Functions |
|
| static int | StringToExaDatatype (const char *str) |
| static char * | ExaDatatypeToString (const int type) |
Public Attributes | |
| rapidjson::Document | resultSet |
| rapidjson::Value * | data |
| bool | json_debug_output = false |
Protected Member Functions |
|
| int | ws_send_data (const char *data, int len=-1, int type=1) |
| std::string | ws_receive_data () |
Static Protected Member Functions |
|
| static void | append_data_from_Rapid_JSON_Document (exaResultSetHandler *rs, const rapidjson::Value &JSONdata) |
| static exaResultSetHandler * | create_exaResultSetHandler_from_RapidJSON_Document (const rapidjson::Value &JSONresultSet, int handle=-1) |
| exasockets_connection::exasockets_connection | ( | const char * | server, |
| uint16_t | port, | ||
| const char * | clientName, | ||
| const char * | username, | ||
| const char * | password, | ||
| int | pwd_len, | ||
| bool | autocommit = true, |
||
| bool | use_compression = false, |
||
| uint64_t | sessionId = 0, |
||
| bool | debug = false |
||
| ) |
Establishes a connection to EXASOL and returns an exasockets_connection object.
| server | The IP address of the EXASOL node to connect to. E.g. '192.168.137.10' |
| port | The Port the EXASOL DB listens on. E.g. 8563 |
| clientName | The name of the client, as it will be shown e.g. in the CLIENT column in EXA_(USER/ALL/DBA)_SESSIONS. E.g. the name of the frontend. |
| username | The EXASOL DB user name for authentification. E.g. 'sys' |
| password | The EXASOL user password. E.g. 'exasol'. Transfer is always RSA encrypted. |
| pwd_len | The password length. E.g. 6. |
| autocommit | If the DBMS is supposed to execute a COMMIT automatically after each statement. Default: true (recommended) |
| use_compression | If the result sets are to be transferred compressed. Default: false. Compression is not yet implemented on the client side. |
| sessionId | An ID for the session to be created in EXASOL. Per default a random session ID is created (recommended). |
| debug | A boolean that controls debug output. If true, all sent and received JSON elements are written to stdout. Default: false |
|
virtual |
Closes a prepared statement.
Sends to the DB the command to close the prepared statement.
| rs | A reference to an exaResultSetHandler object related to the result set to be closed. |
|
virtual |
Closes a result set.
Sends to the DB the command to dispose the result set.
| rs | A reference to an exaResultSetHandler object related to the result set to be closed. |
|
virtual |
Closes a result set.
Sends to the DB the command to dispose the result set.
| handle | An exaResultSetHandler object related to the result set to be closed. |
|
virtual |
Creates a prepared statement.
Sends to the DB the command to prepare a statement.
| sql | A character string containing the SQL statement to prepare. |
| int exasockets_connection::disconnect | ( | bool | throw_message = true |
) |
Disconnect from EXASOL DB.
If the connection is still alive, a clean disconnect from EXASOL DB is performed.
| throw_message | If true, a status message is thrown to stdout. |
|
virtual |
Executes a previously prepared statement.
Sends to the DB the command to execute a previously prepared statement.
| rs | An exaResultSetHandler affiliated with the statement prepared. |
|
virtual |
Sends an SQL statement to EXASOL and fetches the response.
Sends an SQL stmt and fetches the result set. If a result set handle is received instead of data, then this is returned as an int. Otherwise 0 is returned and the resultSet is stored inside the connection object.
| sql | The SQL statement, e.g. 'select * from schema1.tbl1' |
| int64_t exasockets_connection::fetch | ( | exaResultSetHandler * | rs, |
| uint64_t | numRows = 10000, |
||
| uint64_t | startPosition = 1, |
||
| uint64_t | numBytes = 10485760 |
||
| ) |
Fetches a result set.
Takes a result set handle ID and fetches a result set, to be stored in the object->data.
| rs | An exaResultSetHandler object to be filled with data. |
| resultSetHandle | The id of the result set. |
| numRows | Amount of rows to fetch. Default: 10 000 |
| startPosition | row offset from which to begin data retrieval (first row of the table: row 1). Default: 1 |
| numBytes | Number of bytes to retrieve. Default: 10 485 760 (10 MB) |