Implements generic database functionality.
More...
#include <DatabaseUtility.h>
|
static CassSession * | connect (std::string ip, int port, std::string keyspace) |
| Establishes a connection to the database. More...
|
|
static const CassPrepared * | prepareStatement (CassSession *connection, std::string query) |
| Prepares a specified statement (query) to be executed later. More...
|
|
static std::string | getString (const CassRow *row, const char *column) |
| Retrieves a string in a column and some row. More...
|
|
static int | getInt32 (const CassRow *row, const char *column) |
| Retrieves a 32-bit integer from a row. More...
|
|
static long long | getInt64 (const CassRow *row, const char *column) |
| Retrieves a 64-bit integer from a row. More...
|
|
static std::string | getUUID (const CassRow *row, const char *column) |
| Retrieves a UUID from a row and converts it to a string. More...
|
|
Implements generic database functionality.
◆ connect()
CassSession * DatabaseUtility::connect |
( |
std::string |
ip, |
|
|
int |
port, |
|
|
std::string |
keyspace |
|
) |
| |
|
static |
Establishes a connection to the database.
- Parameters
-
connection | Pointer to the connection variable to write to. |
ip | The ip in string format. |
port | The portnumber to connect to. |
keyspace | The keyspace to connect to. |
◆ getInt32()
int DatabaseUtility::getInt32 |
( |
const CassRow * |
row, |
|
|
const char * |
column |
|
) |
| |
|
static |
Retrieves a 32-bit integer from a row.
- Parameters
-
row | The corresponding row. |
column | The corresponding column. |
◆ getInt64()
long long DatabaseUtility::getInt64 |
( |
const CassRow * |
row, |
|
|
const char * |
column |
|
) |
| |
|
static |
Retrieves a 64-bit integer from a row.
- Parameters
-
row | The corresponding row. |
column | The corresponding column. |
◆ getString()
std::string DatabaseUtility::getString |
( |
const CassRow * |
row, |
|
|
const char * |
column |
|
) |
| |
|
static |
Retrieves a string in a column and some row.
- Parameters
-
row | The corresponding row. |
column | The corresponding column. |
◆ getUUID()
std::string DatabaseUtility::getUUID |
( |
const CassRow * |
row, |
|
|
const char * |
column |
|
) |
| |
|
static |
Retrieves a UUID from a row and converts it to a string.
- Parameters
-
row | The corresponding row. |
column | The corresponding column. |
◆ prepareStatement()
const CassPrepared * DatabaseUtility::prepareStatement |
( |
CassSession * |
connection, |
|
|
std::string |
query |
|
) |
| |
|
static |
Prepares a specified statement (query) to be executed later.
- Parameters
-
connection | The connection to prepare the statement on. |
query | A string containing the CQL-query to be executed later. |
- Returns
- The constant prepared statement that allows us to execute the query given as input.
The documentation for this class was generated from the following files:
- SearchSECODatabaseAPI/General/DatabaseUtility.h
- SearchSECODatabaseAPI/General/DatabaseUtility.cpp