relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
Loading...
Searching...
No Matches
relx::schema::column_check_constraint< ColumnPtr, Condition, Name > Class Template Reference

Check constraint explicitly associated with a column. More...

#include <relx/schema/check_constraint.hpp>

Public Member Functions

constexpr std::string sql_definition () const
 Get SQL definition for the column-specific CHECK constraint.
 
constexpr std::string_view condition () const
 Get the condition as a string_view.
 
constexpr std::string_view name () const
 Get the name as a string_view.
 
std::string_view column_name () const
 Get the associated column name.
 

Detailed Description

template<auto ColumnPtr, fixed_string Condition, fixed_string Name = "">
class relx::schema::column_check_constraint< ColumnPtr, Condition, Name >

Check constraint explicitly associated with a column.

Uses compile-time string literals for the condition and binds to a specific column

Template Parameters
ColumnPtrPointer to the column to which the constraint applies
ConditionThe SQL condition as a fixed_string
NameOptional name for the constraint

Definition at line 49 of file check_constraint.hpp.

Member Function Documentation

◆ column_name()

template<auto ColumnPtr, fixed_string Condition, fixed_string Name = "">
std::string_view relx::schema::column_check_constraint< ColumnPtr, Condition, Name >::column_name ( ) const
inline

Get the associated column name.

Returns
The column name

Definition at line 81 of file check_constraint.hpp.

◆ condition()

template<auto ColumnPtr, fixed_string Condition, fixed_string Name = "">
constexpr std::string_view relx::schema::column_check_constraint< ColumnPtr, Condition, Name >::condition ( ) const
inlineconstexpr

Get the condition as a string_view.

Returns
The condition string

Definition at line 73 of file check_constraint.hpp.

◆ name()

template<auto ColumnPtr, fixed_string Condition, fixed_string Name = "">
constexpr std::string_view relx::schema::column_check_constraint< ColumnPtr, Condition, Name >::name ( ) const
inlineconstexpr

Get the name as a string_view.

Returns
The constraint name

Definition at line 77 of file check_constraint.hpp.

◆ sql_definition()

template<auto ColumnPtr, fixed_string Condition, fixed_string Name = "">
constexpr std::string relx::schema::column_check_constraint< ColumnPtr, Condition, Name >::sql_definition ( ) const
inlineconstexpr

Get SQL definition for the column-specific CHECK constraint.

Returns
SQL string defining the constraint

Definition at line 53 of file check_constraint.hpp.


The documentation for this class was generated from the following file: