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>
23template <SomeSettingsProv
ider SettingsProv
iderType>
41 return handle_.get().prepare(
44 INSERT INTO {} (is_latest, sequence) VALUES (?, ?) IF NOT EXISTS
58 return handle_.get().prepare(
75 return handle_.get().prepare(
80 WHERE is_latest in (True, False)
94 return handle_.get().prepare(
101 ORDER BY taxon ASC, token_id ASC
118 LOG(log_.info()) <<
"Preparing aws keyspace statements";
119 statements_ = std::make_unique<KeyspaceStatements>(settingsProvider_, handle);
120 LOG(log_.info()) <<
"Finished preparing statements";
128 std::unique_ptr<KeyspaceStatements>
const&
135 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:24
Schema(SettingsProviderType const &settingsProvider)
Shared Schema's between all Schema classes (Cassandra and Keyspace).
Definition Schema.hpp:56
std::unique_ptr< KeyspaceStatements > const & operator->() const
Provides access to statements.
Definition KeyspaceSchema.hpp:129
void prepareStatements(Handle const &handle) override
Recreates the prepared statements, including the Keyspace-specific ones.
Definition KeyspaceSchema.hpp:116
Statements(SettingsProviderType const &settingsProvider, Handle const &handle)
Construct a new Statements object.
Definition Schema.hpp:379
Schema(SettingsProviderType const &settingsProvider)
Shared Schema's between all Schema classes (Cassandra and Keyspace).
Definition Schema.hpp:56
Provides settings for BasicCassandraBackend.
Definition SettingsProvider.hpp:17
This namespace implements a wrapper for the Cassandra C++ driver.
Definition CassandraBackendFamily.hpp:50
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
impl::PreparedStatement PreparedStatement
A prepared statement.
Definition Types.hpp:28
Construct a new Keyspace Schema object.
Definition KeyspaceSchema.hpp:31
PreparedStatement insertLedgerRange
Insert a ledger_range row (min or max sequence) if it does not exist.
Definition KeyspaceSchema.hpp:40
PreparedStatement selectNFTsAfterTaxonKeyspaces
Select a page of NFT IDs for an issuer with taxon above a given one.
Definition KeyspaceSchema.hpp:93
PreparedStatement updateLedgerRange
Conditionally update a ledger_range sequence (LWT on the previous value).
Definition KeyspaceSchema.hpp:57
PreparedStatement selectLedgerRange
Select both the min and max sequences from ledger_range.
Definition KeyspaceSchema.hpp:74