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

Check constraint that accepts a condition string at compile time. More...

#include <relx/schema/check_constraint.hpp>

Public Member Functions

constexpr std::string sql_definition () const
 Get SQL definition for the 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.
 

Detailed Description

template<fixed_string Condition, fixed_string Name = "">
class relx::schema::table_check_constraint< Condition, Name >

Check constraint that accepts a condition string at compile time.

Uses compile-time string literals to define the constraint condition

Template Parameters
ConditionThe SQL condition as a fixed_string
NameOptional name for the constraint

Definition at line 17 of file check_constraint.hpp.

Member Function Documentation

◆ condition()

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

Get the condition as a string_view.

Returns
The condition string

Definition at line 36 of file check_constraint.hpp.

◆ name()

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

Get the name as a string_view.

Returns
The constraint name

Definition at line 40 of file check_constraint.hpp.

◆ sql_definition()

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

Get SQL definition for the CHECK constraint.

Returns
SQL string defining the constraint

Definition at line 21 of file check_constraint.hpp.


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