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 updateLedgerRange = [
this]() {
57 return handle_.get().prepare(
63 IF sequence IN (?, null)
74 PreparedStatement selectNFTIDsByIssuer = [
this]() {
75 return handle_.get().prepare(
81 AND (taxon, token_id) > ?
82 ORDER BY taxon ASC, token_id ASC
90 PreparedStatement selectAccountFromBeginning = [
this]() {
91 return handle_.get().prepare(
96 WHERE token(account) > 0
105 PreparedStatement selectAccountFromToken = [
this]() {
106 return handle_.get().prepare(
111 WHERE token(account) > token(?)
112 PER PARTITION LIMIT 1
120 PreparedStatement selectLedgerPageKeys = [
this]() {
121 return handle_.get().prepare(
126 WHERE TOKEN(key) >= ?
128 PER PARTITION LIMIT 1
137 PreparedStatement selectLedgerPage = [
this]() {
138 return handle_.get().prepare(
143 WHERE TOKEN(key) >= ?
145 PER PARTITION LIMIT 1
158 LOG(log_.info()) <<
"Preparing cassandra statements";
159 statements_ = std::make_unique<CassandraStatements>(settingsProvider_, handle);
160 LOG(log_.info()) <<
"Finished preparing statements";
168 std::unique_ptr<CassandraStatements>
const&
175 std::unique_ptr<CassandraStatements> statements_{
nullptr};
Manages the DB schema and provides access to prepared statements.
Definition CassandraSchema.hpp:41
std::unique_ptr< CassandraStatements > const & operator->() const
Provides access to statements.
Definition CassandraSchema.hpp:169
void prepareStatements(Handle const &handle) override
Recreates the prepared statements.
Definition CassandraSchema.hpp:156
Represents a handle to the cassandra database cluster.
Definition Handle.hpp:46
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 Cassandra Schema object.
Definition CassandraSchema.hpp:50