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

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

#include <Schema.hpp>

Classes

class  Statements
 Prepared statements holder. More...
 

Public Member Functions

 Schema (SettingsProviderType const &settingsProvider)
 Construct a new Schema object.
 
void prepareStatements (Handle const &handle)
 Recreates the prepared statements.
 
std::unique_ptr< Statements > const & operator-> () const
 Provides access to statements.
 

Public Attributes

std::string createKeyspace
 
std::vector< StatementcreateSchema
 

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

Construct a new Schema object.

Parameters
settingsProviderThe settings provider

Member Function Documentation

◆ operator->()

template<SomeSettingsProvider SettingsProviderType>
std::unique_ptr< Statements > const & data::cassandra::Schema< SettingsProviderType >::operator-> ( ) const
inline

Provides access to statements.

Returns
The statements

◆ prepareStatements()

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

Recreates the prepared statements.

Parameters
handleThe handle to the DB

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: