Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
data::cassandra::Schema< SettingsProviderType > Class Template Referenceabstract

Manages the DB schema and provides access to prepared statements. More...

#include <Schema.hpp>

Collaboration diagram for data::cassandra::Schema< SettingsProviderType >:

Classes

class  Statements
 Prepared statements holder. More...

Public Member Functions

 Schema (SettingsProviderType const &settingsProvider)
 Shared Schema's between all Schema classes (Cassandra and Keyspace)
virtual void prepareStatements (Handle const &handle)=0
 Recreates the prepared statements.

Public Attributes

std::string createKeyspace
std::vector< StatementcreateSchema

Protected Attributes

util::Logger log_ {"Backend"}
std::reference_wrapper< SettingsProviderType const > settingsProvider_

Detailed Description

template<SomeSettingsProvider SettingsProviderType>
class data::cassandra::Schema< SettingsProviderType >

Manages the DB schema and provides access to prepared statements.

Constructor & Destructor Documentation

◆ Schema()

template<SomeSettingsProvider SettingsProviderType>
data::cassandra::Schema< SettingsProviderType >::Schema ( SettingsProviderType const & settingsProvider)
inlineexplicit

Shared Schema's between all Schema classes (Cassandra and Keyspace)

Parameters
settingsProviderThe settings provider

Member Function Documentation

◆ prepareStatements()

template<SomeSettingsProvider SettingsProviderType>
virtual void data::cassandra::Schema< SettingsProviderType >::prepareStatements ( Handle const & handle)
pure virtual

Recreates the prepared statements.

Parameters
handleThe handle to the DB

Implemented in data::cassandra::CassandraSchema< SettingsProviderType >, and data::cassandra::KeyspaceSchema< SettingsProviderType >.

Member Data Documentation

◆ createKeyspace

template<SomeSettingsProvider SettingsProviderType>
std::string data::cassandra::Schema< SettingsProviderType >::createKeyspace
Initial value:
= [this]() {
return fmt::format(
R"(
CREATE KEYSPACE IF NOT EXISTS {}
WITH replication = {{
'class': 'SimpleStrategy',
'replication_factor': '{}'
}}
AND durable_writes = True
)",
settingsProvider_.get().getKeyspace(),
settingsProvider_.get().getReplicationFactor()
);
}()

The documentation for this class was generated from the following file: