relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
Loading...
Searching...
No Matches
foreign_key.hpp File Reference
#include "../utils/error_handling.hpp"
#include "column.hpp"
#include "meta.hpp"
#include <array>
#include <string_view>
#include <type_traits>

Go to the source code of this file.

Classes

class  relx::schema::foreign_key< LocalColumnPtr, ReferencedColumnPtr >
 Represents a foreign key constraint on a table. More...
 
class  relx::schema::composite_foreign_key< ColumnPtrs >
 Represents a composite foreign key constraint with multiple columns. More...
 
struct  relx::schema::fk_impl< std::tuple< std::integral_constant< decltype(LocalColumns), LocalColumns >... >, std::tuple< std::integral_constant< decltype(ReferencedColumns), ReferencedColumns >... > >
 
struct  relx::schema::pack_element< 0, First, Rest... >
 
struct  relx::schema::pack_element< N, First, Rest... >
 

Namespaces

namespace  relx
 relx database connection
 
namespace  relx::schema
 

Typedefs

template<auto... Args>
using relx::schema::fk = decltype(make_fk< Args... >())
 Type alias for foreign key using the make_fk helper.
 

Enumerations

enum class  relx::schema::reference_action {
  relx::schema::cascade , relx::schema::restrict , relx::schema::set_null , relx::schema::set_default ,
  relx::schema::no_action
}
 Foreign key actions. More...
 

Functions

constexpr std::string_view relx::schema::reference_action_to_string (reference_action action)
 Convert reference action to SQL string.
 
template<auto... Args>
auto relx::schema::make_fk ()
 Helper function to create a foreign key.
 
template<auto... Args>
auto relx::schema::make_fk (reference_action on_delete, reference_action on_update)
 Helper function to create a foreign key with reference actions.