22#include "data/cassandra/Concepts.hpp"
23#include "data/cassandra/Handle.hpp"
24#include "data/cassandra/Schema.hpp"
25#include "data/cassandra/SettingsProvider.hpp"
26#include "data/cassandra/Types.hpp"
27#include "util/log/Logger.hpp"
29#include <boost/json/string.hpp>
30#include <fmt/compile.h>
40template <SomeSettingsProv
ider SettingsProv
iderType>
56 PreparedStatement insertLedgerRange = [
this]() {
57 return handle_.get().prepare(
60 INSERT INTO {} (is_latest, sequence) VALUES (?, ?) IF NOT EXISTS
70 PreparedStatement updateLedgerRange = [
this]() {
71 return handle_.get().prepare(
84 PreparedStatement selectLedgerRange = [
this]() {
85 return handle_.get().prepare(
90 WHERE is_latest in (True, False)
100 PreparedStatement selectNFTsAfterTaxonKeyspaces = [
this]() {
101 return handle_.get().prepare(
108 ORDER BY taxon ASC, token_id ASC
120 LOG(log_.info()) <<
"Preparing aws keyspace statements";
121 statements_ = std::make_unique<KeyspaceStatements>(settingsProvider_, handle);
122 LOG(log_.info()) <<
"Finished preparing statements";
130 std::unique_ptr<KeyspaceStatements>
const&
137 std::unique_ptr<KeyspaceStatements> statements_{
nullptr};
Represents a handle to the cassandra database cluster.
Definition Handle.hpp:46
Manages the DB schema and provides access to prepared statements.
Definition KeyspaceSchema.hpp:41
Schema(SettingsProviderType const &settingsProvider)
Shared Schema's between all Schema classes (Cassandra and Keyspace)
Definition Schema.hpp:68
std::unique_ptr< KeyspaceStatements > const & operator->() const
Provides access to statements.
Definition KeyspaceSchema.hpp:131
void prepareStatements(Handle const &handle) override
Recreates the prepared statements.
Definition KeyspaceSchema.hpp:118
Statements(SettingsProviderType const &settingsProvider, Handle const &handle)
Construct a new Statements object.
Definition Schema.hpp:351
Schema(SettingsProviderType const &settingsProvider)
Shared Schema's between all Schema classes (Cassandra and Keyspace)
Definition Schema.hpp:68
Provides settings for BasicCassandraBackend.
Definition SettingsProvider.hpp:35
This namespace implements a wrapper for the Cassandra C++ driver.
Definition CassandraBackendFamily.hpp:66
std::string qualifiedTableName(SettingsProviderType const &provider, std::string_view name)
Returns the table name qualified with the keyspace and table prefix.
Definition Schema.hpp:46
Construct a new Keyspace Schema object.
Definition KeyspaceSchema.hpp:50