3#include "data/cassandra/Concepts.hpp"
4#include "data/cassandra/Handle.hpp"
5#include "data/cassandra/Schema.hpp"
6#include "data/cassandra/SettingsProvider.hpp"
7#include "data/cassandra/Types.hpp"
8#include "util/log/Logger.hpp"
10#include <boost/json/string.hpp>
11#include <fmt/compile.h>
21template <SomeSettingsProv
ider SettingsProv
iderType>
37 PreparedStatement insertLedgerRange = [
this]() {
38 return handle_.get().prepare(
41 INSERT INTO {} (is_latest, sequence) VALUES (?, ?) IF NOT EXISTS
51 PreparedStatement updateLedgerRange = [
this]() {
52 return handle_.get().prepare(
65 PreparedStatement selectLedgerRange = [
this]() {
66 return handle_.get().prepare(
71 WHERE is_latest in (True, False)
81 PreparedStatement selectNFTsAfterTaxonKeyspaces = [
this]() {
82 return handle_.get().prepare(
89 ORDER BY taxon ASC, token_id ASC
101 LOG(log_.info()) <<
"Preparing aws keyspace statements";
102 statements_ = std::make_unique<KeyspaceStatements>(settingsProvider_, handle);
103 LOG(log_.info()) <<
"Finished preparing statements";
111 std::unique_ptr<KeyspaceStatements>
const&
118 std::unique_ptr<KeyspaceStatements> statements_{
nullptr};
Represents a handle to the cassandra database cluster.
Definition Handle.hpp:27
Manages the DB schema and provides access to prepared statements.
Definition KeyspaceSchema.hpp:22
Schema(SettingsProviderType const &settingsProvider)
Shared Schema's between all Schema classes (Cassandra and Keyspace).
Definition Schema.hpp:54
std::unique_ptr< KeyspaceStatements > const & operator->() const
Provides access to statements.
Definition KeyspaceSchema.hpp:112
void prepareStatements(Handle const &handle) override
Recreates the prepared statements.
Definition KeyspaceSchema.hpp:99
Statements(SettingsProviderType const &settingsProvider, Handle const &handle)
Construct a new Statements object.
Definition Schema.hpp:338
Schema(SettingsProviderType const &settingsProvider)
Shared Schema's between all Schema classes (Cassandra and Keyspace).
Definition Schema.hpp:54
Provides settings for BasicCassandraBackend.
Definition SettingsProvider.hpp:16
This namespace implements a wrapper for the Cassandra C++ driver.
Definition CassandraBackendFamily.hpp:47
std::string qualifiedTableName(SettingsProviderType const &provider, std::string_view name)
Returns the table name qualified with the keyspace and table prefix.
Definition Schema.hpp:27
Construct a new Keyspace Schema object.
Definition KeyspaceSchema.hpp:31