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 updateLedgerRange = [
this]() {
38 return handle_.get().prepare(
44 IF sequence IN (?, null)
55 PreparedStatement selectNFTIDsByIssuer = [
this]() {
56 return handle_.get().prepare(
62 AND (taxon, token_id) > ?
63 ORDER BY taxon ASC, token_id ASC
71 PreparedStatement selectAccountFromBeginning = [
this]() {
72 return handle_.get().prepare(
77 WHERE token(account) > 0
86 PreparedStatement selectAccountFromToken = [
this]() {
87 return handle_.get().prepare(
92 WHERE token(account) > token(?)
101 PreparedStatement selectLedgerPageKeys = [
this]() {
102 return handle_.get().prepare(
107 WHERE TOKEN(key) >= ?
109 PER PARTITION LIMIT 1
118 PreparedStatement selectLedgerPage = [
this]() {
119 return handle_.get().prepare(
124 WHERE TOKEN(key) >= ?
126 PER PARTITION LIMIT 1
139 LOG(log_.info()) <<
"Preparing cassandra statements";
140 statements_ = std::make_unique<CassandraStatements>(settingsProvider_, handle);
141 LOG(log_.info()) <<
"Finished preparing statements";
149 std::unique_ptr<CassandraStatements>
const&
156 std::unique_ptr<CassandraStatements> statements_{
nullptr};
Manages the DB schema and provides access to prepared statements.
Definition CassandraSchema.hpp:22
std::unique_ptr< CassandraStatements > const & operator->() const
Provides access to statements.
Definition CassandraSchema.hpp:150
void prepareStatements(Handle const &handle) override
Recreates the prepared statements.
Definition CassandraSchema.hpp:137
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: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 Cassandra Schema object.
Definition CassandraSchema.hpp:31