19#ifndef CQL_CONNECTION_H
20#define CQL_CONNECTION_H
30#include <unordered_map>
94 return std::hash<std::string>{}(std::string(key));
101 return std::strcmp(lhs, rhs) == 0;
106typedef std::unordered_map<
StatementTag, CqlTaggedStatement,
184 static const std::string
Common CQL connector pool.
virtual ~CqlConnection()
Destructor.
StatementMap statements_
Pointer to external array of tagged statements containing statement name, array of names of bind para...
virtual void commit()
Commit Transactions.
void startTransaction()
Start transaction.
virtual void rollback()
Rollback Transactions.
CassSession * session_
CQL session handle.
bool force_consistency_
CQL consistency enabled.
const CassKeyspaceMeta * keyspace_meta_
Keyspace meta information, used for UDTs.
CassCluster * cluster_
CQL connection handle.
void openDatabase()
Open database.
CassConsistency consistency_
CQL consistency.
const CassSchemaMeta * schema_meta_
static const std::string checkFutureError(const std::string &what, CassFuture *future, StatementTag statement_tag=NULL)
Check for errors.
void prepareStatements(StatementMap &statements)
Prepare statements.
void setConsistency(bool force, CassConsistency consistency)
Set consistency.
Common database connection class.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
char const *const StatementTag
Statement index representing the statement name.
std::pair< StatementTag, CqlTaggedStatement > StatementMapEntry
A type for a single entry on the statements map.
std::pair< uint32_t, uint32_t > VersionPair
Pair containing major and minor versions.
std::shared_ptr< CqlConnection > CqlConnectionPtr
constexpr uint32_t CQL_SCHEMA_VERSION_MINOR
constexpr uint32_t CQL_SCHEMA_VERSION_MAJOR
Define CQL schema version: 3.0.
constexpr uint32_t CQL_DRIVER_VERSION_MAJOR
Define CQL backend version.
std::unordered_map< StatementTag, CqlTaggedStatement, StatementTagHash, StatementTagEqual > StatementMap
A container for all statements.
constexpr uint32_t CQL_DRIVER_VERSION_MINOR
Defines the logger used by the top-level component of kea-dhcp-ddns.
Defines a single statement or query.
StatementTag name_
Short description of the query.
CqlTaggedStatement(StatementTag name, char const *const text)
Constructor.
char const *const text_
Text representation of the actual query.
CqlTaggedStatement(StatementTag name, char const *const text, bool const &is_raw)
Constructor.
bool is_raw_
Should the statement be executed raw or with binds?
const CassPrepared * prepared_statement_
Internal Cassandra object representing the prepared statement.
Equality function for StatementMap keys.
bool operator()(StatementTag const &lhs, StatementTag const &rhs) const
Hash function for StatementMap keys.
size_t operator()(StatementTag const &key) const