Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Spec.hpp
1#pragma once
2
3#include <boost/asio/spawn.hpp>
4
5#include <concepts>
6#include <tuple>
7#include <type_traits>
8
9namespace migration::cassandra::impl {
10// Define the concept for a class like TableObjectsDesc
11template <typename T>
12concept TableSpec = requires {
13 // Check that 'row' exists and is a tuple
14 // keys types are at the beginning and the other fields types sort in alphabetical order
15 typename T::Row;
16 requires std::tuple_size<typename T::Row>::value >= 0; // Ensures 'row' is a tuple
17
18 // Check that static constexpr members 'partitionKey' and 'tableName' exist
19 { T::kPARTITION_KEY } -> std::convertible_to<char const*>;
20 { T::kTABLE_NAME } -> std::convertible_to<char const*>;
21};
22} // namespace migration::cassandra::impl