Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
data::cassandra Namespace Reference

This namespace implements a wrapper for the Cassandra C++ driver. More...

Classes

class  BasicCassandraBackend
 Implements BackendInterface for Cassandra/ScyllaDB. More...
 
class  CassandraError
 A simple container for both error message and error code. More...
 
class  Handle
 Represents a handle to the cassandra database cluster. More...
 
struct  Limit
 A strong type wrapper for int32_t. More...
 
class  Schema
 Manages the DB schema and provides access to prepared statements. More...
 
class  SettingsProvider
 Provides settings for BasicCassandraBackend. More...
 
struct  Text
 A strong type wrapper for string. More...
 

Concepts

concept  SomeSettingsProvider
 The requirements of a settings provider.
 
concept  SomeExecutionStrategy
 The requirements of an execution strategy.
 
concept  SomeRetryPolicy
 The requirements of a retry policy.
 

Typedefs

using Settings = impl::Settings
 
using Future = impl::Future
 
using FutureWithCallback = impl::FutureWithCallback
 
using Result = impl::Result
 
using Statement = impl::Statement
 
using PreparedStatement = impl::PreparedStatement
 
using Batch = impl::Batch
 
using MaybeError = std::expected<void, CassandraError>
 
using ResultOrError = std::expected<Result, CassandraError>
 
using Error = std::unexpected<CassandraError>
 
using CassandraBackend = BasicCassandraBackend<SettingsProvider, impl::DefaultExecutionStrategy<>>
 

Functions

template<typename... Types>
impl::ResultExtractor< Types... > extract (Handle::ResultType const &result)
 Extracts the results into series of std::tuple<Types...> by creating a simple wrapper with an STL input iterator inside.
 
template<SomeSettingsProvider SettingsProviderType>
std::string qualifiedTableName (SettingsProviderType const &provider, std::string_view name)
 Returns the table name qualified with the keyspace and table prefix.
 

Detailed Description

This namespace implements a wrapper for the Cassandra C++ driver.

Function Documentation

◆ extract()

template<typename... Types>
impl::ResultExtractor< Types... > data::cassandra::extract ( Handle::ResultType const & result)
nodiscard

Extracts the results into series of std::tuple<Types...> by creating a simple wrapper with an STL input iterator inside.

You can call .begin() and .end() in order to iterate as usual. This also means that you can use it in a range-based for or with some algorithms.

Template Parameters
TypesThe types to extract
Parameters
resultThe result to iterate
Returns
An extractor object (iterator inside)

◆ qualifiedTableName()

template<SomeSettingsProvider SettingsProviderType>
std::string data::cassandra::qualifiedTableName ( SettingsProviderType const & provider,
std::string_view name )
inlinenodiscard

Returns the table name qualified with the keyspace and table prefix.

Template Parameters
SettingsProviderTypeThe settings provider type
Parameters
providerThe settings provider
nameThe name of the table
Returns
The qualified table name