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(
47 IF sequence IN (?, null)
62 return handle_.get().prepare(
68 AND (taxon, token_id) > ?
69 ORDER BY taxon ASC, token_id ASC
81 return handle_.get().prepare(
86 WHERE token(account) > 0
99 return handle_.get().prepare(
104 WHERE token(account) > token(?)
105 PER PARTITION LIMIT 1
117 return handle_.get().prepare(
122 WHERE TOKEN(key) >= ?
124 PER PARTITION LIMIT 1
137 return handle_.get().prepare(
142 WHERE TOKEN(key) >= ?
144 PER PARTITION LIMIT 1
162 LOG(log_.info()) <<
"Preparing cassandra statements";
163 statements_ = std::make_unique<CassandraStatements>(settingsProvider_, handle);
164 LOG(log_.info()) <<
"Finished preparing statements";
172 std::unique_ptr<CassandraStatements>
const&
179 std::unique_ptr<CassandraStatements> statements_{
nullptr};
Manages the DB schema and provides access to prepared statements.
Definition CassandraSchema.hpp:24
std::unique_ptr< CassandraStatements > const & operator->() const
Provides access to statements.
Definition CassandraSchema.hpp:173
void prepareStatements(Handle const &handle) override
Recreates the prepared statements, including the Cassandra-specific ones.
Definition CassandraSchema.hpp:160
Represents a handle to the cassandra database cluster.
Definition Handle.hpp:27
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 Cassandra Schema object.
Definition CassandraSchema.hpp:31
PreparedStatement selectLedgerPageKeys
Select a page of object keys from a token as of a ledger sequence.
Definition CassandraSchema.hpp:116
PreparedStatement updateLedgerRange
Conditionally update a ledger_range sequence (LWT on previous value or null).
Definition CassandraSchema.hpp:40
PreparedStatement selectLedgerPage
Select a page of objects and keys from a token as of a ledger sequence.
Definition CassandraSchema.hpp:136
PreparedStatement selectAccountFromBeginning
Select a page of distinct accounts from the start of account_tx.
Definition CassandraSchema.hpp:80
PreparedStatement selectAccountFromToken
Select a page of distinct accounts in account_tx after a given account.
Definition CassandraSchema.hpp:98
PreparedStatement selectNFTIDsByIssuer
Select a page of NFT IDs for an issuer after a (taxon, token ID) cursor.
Definition CassandraSchema.hpp:61