Lightweight 0.20260213.0
Loading...
Searching...
No Matches
Lightweight::SqlWhereClauseBuilder< Derived > Class Template Reference

#include <Core.hpp>

Inherited by Lightweight::SqlBasicSelectQueryBuilder< SqlAllFieldsQueryBuilder< Record, QueryOptions > >, Lightweight::SqlBasicSelectQueryBuilder< SqlAllFieldsQueryBuilder< std::tuple< FirstRecord, SecondRecord >, QueryOptions > >, Lightweight::SqlBasicSelectQueryBuilder< SqlSelectQueryBuilder >, and Lightweight::SqlBasicSelectQueryBuilder< Derived >.

Public Member Functions

Derived & And () noexcept
 Indicates, that the next WHERE clause should be AND-ed (default).
 
Derived & Or () noexcept
 Indicates, that the next WHERE clause should be OR-ed.
 
Derived & Not () noexcept
 Indicates, that the next WHERE clause should be negated.
 
Derived & WhereRaw (std::string_view sqlConditionExpression)
 Constructs or extends a raw WHERE clause.
 
template<typename ColumnName , typename T >
Derived & Where (ColumnName const &columnName, std::string_view binaryOp, T const &value)
 Constructs or extends a WHERE clause to test for a binary operation.
 
template<typename ColumnName , typename SubSelectQuery >
requires (std::is_invocable_r_v<std::string, decltype(&SubSelectQuery::ToSql), SubSelectQuery const&>)
Derived & Where (ColumnName const &columnName, std::string_view binaryOp, SubSelectQuery const &value)
 Constructs or extends a WHERE clause to test for a binary operation for RHS as sub-select query.
 
template<typename ColumnName , typename T >
Derived & OrWhere (ColumnName const &columnName, std::string_view binaryOp, T const &value)
 Constructs or extends a WHERE/OR clause to test for a binary operation.
 
template<typename ColumnName , std::size_t N>
Derived & Where (ColumnName const &columnName, std::string_view binaryOp, char const (&value)[N])
 Constructs or extends a WHERE clause to test for a binary operation for RHS as string literal.
 
template<typename ColumnName , typename T >
Derived & Where (ColumnName const &columnName, T const &value)
 Constructs or extends a WHERE clause to test for equality.
 
template<typename ColumnName , typename T >
Derived & OrWhere (ColumnName const &columnName, T const &value)
 Constructs or extends an WHERE/OR clause to test for equality.
 
template<typename Callable >
requires std::invocable<Callable, SqlWhereClauseBuilder<Derived>&>
Derived & Where (Callable const &callable)
 Constructs or extends a WHERE/AND clause to test for a group of values.
 
template<typename Callable >
requires std::invocable<Callable, SqlWhereClauseBuilder<Derived>&>
Derived & OrWhere (Callable const &callable)
 Constructs or extends an WHERE/OR clause to test for a group of values.
 
template<typename ColumnName , std::ranges::input_range InputRange>
Derived & WhereIn (ColumnName const &columnName, InputRange const &values)
 Constructs or extends an WHERE/OR clause to test for a value, satisfying std::ranges::input_range.
 
template<typename ColumnName , typename T >
Derived & WhereIn (ColumnName const &columnName, std::initializer_list< T > const &values)
 Constructs or extends an WHERE/OR clause to test for a value, satisfying std::initializer_list.
 
template<typename ColumnName , typename SubSelectQuery >
requires (std::is_invocable_r_v<std::string, decltype(&SubSelectQuery::ToSql), SubSelectQuery const&>)
Derived & WhereIn (ColumnName const &columnName, SubSelectQuery const &subSelectQuery)
 Constructs or extends an WHERE/OR clause to test for a value, satisfying a sub-select query.
 
template<typename ColumnName >
Derived & WhereNull (ColumnName const &columnName)
 Constructs or extends an WHERE/OR clause to test for a value to be NULL.
 
template<typename ColumnName >
Derived & WhereNotNull (ColumnName const &columnName)
 Constructs or extends a WHERE clause to test for a value being not null.
 
template<typename ColumnName , typename T >
Derived & WhereNotEqual (ColumnName const &columnName, T const &value)
 Constructs or extends a WHERE clause to test for a value being equal to another column.
 
template<typename ColumnName >
Derived & WhereTrue (ColumnName const &columnName)
 Constructs or extends a WHERE clause to test for a value being true.
 
template<typename ColumnName >
Derived & WhereFalse (ColumnName const &columnName)
 Constructs or extends a WHERE clause to test for a value being false.
 
template<typename LeftColumn , typename RightColumn >
Derived & WhereColumn (LeftColumn const &left, std::string_view binaryOp, RightColumn const &right)
 Construts or extends a WHERE clause to test for a binary operation between two columns.
 
Derived & InnerJoin (TableName auto joinTable, std::string_view joinColumnName, SqlQualifiedTableColumnName onOtherColumn)
 
Derived & InnerJoin (TableName auto joinTable, std::string_view joinColumnName, std::string_view onMainTableColumn)
 Constructs an INNER JOIN clause.
 
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & InnerJoin (TableName auto joinTable, OnChainCallable const &onClauseBuilder)
 Constructs an INNER JOIN clause with a custom ON clause.
 
template<auto LeftField, auto RightField>
Derived & InnerJoin ()
 
Derived & LeftOuterJoin (TableName auto joinTable, std::string_view joinColumnName, SqlQualifiedTableColumnName onOtherColumn)
 Constructs an LEFT OUTER JOIN clause.
 
Derived & LeftOuterJoin (TableName auto joinTable, std::string_view joinColumnName, std::string_view onMainTableColumn)
 Constructs an LEFT OUTER JOIN clause.
 
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & LeftOuterJoin (TableName auto joinTable, OnChainCallable const &onClauseBuilder)
 Constructs an LEFT OUTER JOIN clause with a custom ON clause.
 
Derived & RightOuterJoin (TableName auto joinTable, std::string_view joinColumnName, SqlQualifiedTableColumnName onOtherColumn)
 Constructs an RIGHT OUTER JOIN clause.
 
Derived & RightOuterJoin (TableName auto joinTable, std::string_view joinColumnName, std::string_view onMainTableColumn)
 Constructs an RIGHT OUTER JOIN clause.
 
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & RightOuterJoin (TableName auto joinTable, OnChainCallable const &onClauseBuilder)
 Constructs an RIGHT OUTER JOIN clause with a custom ON clause.
 
Derived & FullOuterJoin (TableName auto joinTable, std::string_view joinColumnName, SqlQualifiedTableColumnName onOtherColumn)
 Constructs an FULL OUTER JOIN clause.
 
Derived & FullOuterJoin (TableName auto joinTable, std::string_view joinColumnName, std::string_view onMainTableColumn)
 Constructs an FULL OUTER JOIN clause.
 
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & FullOuterJoin (TableName auto joinTable, OnChainCallable const &onClauseBuilder)
 Constructs an FULL OUTER JOIN clause with a custom ON clause.
 
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Where (ColumnName const &columnName, T const &value)
 Constructs or extends a WHERE clause to test for equality.
 
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & OrWhere (ColumnName const &columnName, T const &value)
 Constructs or extends a WHERE/OR clause to test for equality.
 
template<typename Callable >
requires std::invocable<Callable, SqlWhereClauseBuilder<Derived>&>
LIGHTWEIGHT_FORCE_INLINE Derived & OrWhere (Callable const &callable)
 Constructs or extends a WHERE/OR clause to test for a group of values.
 
template<typename Callable >
requires std::invocable<Callable, SqlWhereClauseBuilder<Derived>&>
LIGHTWEIGHT_FORCE_INLINE Derived & Where (Callable const &callable)
 Constructs or extends a WHERE/AND clause to test for a group of values.
 
template<typename ColumnName , std::ranges::input_range InputRange>
LIGHTWEIGHT_FORCE_INLINE Derived & WhereIn (ColumnName const &columnName, InputRange const &values)
 Constructs or extends a WHERE IN clause with an input range.
 
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & WhereIn (ColumnName const &columnName, std::initializer_list< T > const &values)
 Constructs or extends a WHERE IN clause with an initializer list.
 
template<typename ColumnName , typename SubSelectQuery >
requires (std::is_invocable_r_v<std::string, decltype(&SubSelectQuery::ToSql), SubSelectQuery const&>)
LIGHTWEIGHT_FORCE_INLINE Derived & WhereIn (ColumnName const &columnName, SubSelectQuery const &subSelectQuery)
 Constructs or extends a WHERE IN clause with a sub-select query.
 
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & WhereNotNull (ColumnName const &columnName)
 Constructs or extends a WHERE clause to test for a value being not null.
 
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & WhereNull (ColumnName const &columnName)
 Constructs or extends a WHERE clause to test for a value being null.
 
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & WhereNotEqual (ColumnName const &columnName, T const &value)
 Constructs or extends a WHERE clause to test for inequality.
 
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & WhereTrue (ColumnName const &columnName)
 Constructs or extends a WHERE clause to test for a value being true.
 
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & WhereFalse (ColumnName const &columnName)
 Constructs or extends a WHERE clause to test for a value being false.
 
template<typename LeftColumn , typename RightColumn >
LIGHTWEIGHT_FORCE_INLINE Derived & WhereColumn (LeftColumn const &left, std::string_view binaryOp, RightColumn const &right)
 Constructs or extends a WHERE clause to compare two columns.
 
template<typename ColumnName , std::size_t N>
LIGHTWEIGHT_FORCE_INLINE Derived & Where (ColumnName const &columnName, std::string_view binaryOp, char const (&value)[N])
 Constructs or extends a WHERE clause with a string literal value.
 
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Where (ColumnName const &columnName, std::string_view binaryOp, T const &value)
 Constructs or extends a WHERE clause to test for a binary operation.
 
template<typename ColumnName , typename SubSelectQuery >
requires (std::is_invocable_r_v<std::string, decltype(&SubSelectQuery::ToSql), SubSelectQuery const&>)
LIGHTWEIGHT_FORCE_INLINE Derived & Where (ColumnName const &columnName, std::string_view binaryOp, SubSelectQuery const &value)
 Constructs or extends a WHERE clause with a sub-select query.
 
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & OrWhere (ColumnName const &columnName, std::string_view binaryOp, T const &value)
 Constructs or extends a WHERE/OR clause with a binary operation.
 
template<typename ColumnName >
requires (std::same_as<ColumnName, SqlQualifiedTableColumnName> || std::convertible_to<ColumnName, std::string_view> || std::same_as<ColumnName, SqlRawColumnNameView> || std::convertible_to<ColumnName, std::string>)
LIGHTWEIGHT_FORCE_INLINE void AppendColumnName (ColumnName const &columnName)
 Appends a column name to the WHERE condition.
 
template<typename LiteralType >
LIGHTWEIGHT_FORCE_INLINE void AppendLiteralValue (LiteralType const &value)
 Appends a literal value to the WHERE condition.
 
template<typename LiteralType , typename TargetType >
LIGHTWEIGHT_FORCE_INLINE void PopulateLiteralValueInto (LiteralType const &value, TargetType &target)
 Populates a literal value into the target string.
 
template<typename Callable >
LIGHTWEIGHT_FORCE_INLINE Derived & Join (JoinType joinType, TableName auto joinTable, Callable const &onClauseBuilder)
 Constructs a JOIN clause with a custom ON clause builder.
 

Detailed Description

template<typename Derived>
class Lightweight::SqlWhereClauseBuilder< Derived >

Helper CRTP-based class for building WHERE clauses.

This class is inherited by the SqlSelectQueryBuilder, SqlUpdateQueryBuilder, and SqlDeleteQueryBuilder

Definition at line 211 of file Core.hpp.

Member Function Documentation

◆ And()

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::And ( )
inlinenoexcept

Indicates, that the next WHERE clause should be AND-ed (default).

Definition at line 563 of file Core.hpp.

◆ Or()

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Or ( )
inlinenoexcept

Indicates, that the next WHERE clause should be OR-ed.

Definition at line 570 of file Core.hpp.

◆ Not()

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Not ( )
inlinenoexcept

Indicates, that the next WHERE clause should be negated.

Definition at line 577 of file Core.hpp.

◆ WhereRaw()

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereRaw ( std::string_view  sqlConditionExpression)
inline

Constructs or extends a raw WHERE clause.

Definition at line 909 of file Core.hpp.

◆ InnerJoin() [1/4]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::InnerJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
SqlQualifiedTableColumnName  onOtherColumn 
)
inline

Constructs an INNER JOIN clause.

Parameters
joinTableThe table's name to join with. This can be a string, a string_view, or an AliasedTableName.
joinColumnNameThe name of the column in the main table to join on.
onOtherColumnThe column in the join table to compare against.

Definition at line 798 of file Core.hpp.

◆ InnerJoin() [2/4]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::InnerJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
std::string_view  onMainTableColumn 
)
inline

Constructs an INNER JOIN clause.

Definition at line 806 of file Core.hpp.

◆ InnerJoin() [3/4]

template<typename Derived >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & Lightweight::SqlWhereClauseBuilder< Derived >::InnerJoin ( TableName auto  joinTable,
OnChainCallable const &  onClauseBuilder 
)

Constructs an INNER JOIN clause with a custom ON clause.

Definition at line 834 of file Core.hpp.

◆ InnerJoin() [4/4]

template<typename Derived >
template<auto LeftField, auto RightField>
Derived & Lightweight::SqlWhereClauseBuilder< Derived >::InnerJoin ( )

Constructs an INNER JOIN clause given two fields from different records using the field name as join column.

Template Parameters
LeftFieldThe field name to join on, such as JoinTestB::a_id, which will join on table JoinTestB with the column a_id to be compared against right field's column.
RightFieldThe other column to compare and join against.

Example:

InnerJoin<&JoinTestB::a_id, &JoinTestA::id>()
// This will generate a INNER JOIN "JoinTestB" ON "InnerTestB"."a_id" = "JoinTestA"."id"

Definition at line 815 of file Core.hpp.

References Lightweight::RecordTableName.

◆ LeftOuterJoin() [1/3]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::LeftOuterJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
SqlQualifiedTableColumnName  onOtherColumn 
)
inline

Constructs an LEFT OUTER JOIN clause.

Definition at line 840 of file Core.hpp.

◆ LeftOuterJoin() [2/3]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::LeftOuterJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
std::string_view  onMainTableColumn 
)
inline

Constructs an LEFT OUTER JOIN clause.

Definition at line 847 of file Core.hpp.

◆ LeftOuterJoin() [3/3]

template<typename Derived >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & Lightweight::SqlWhereClauseBuilder< Derived >::LeftOuterJoin ( TableName auto  joinTable,
OnChainCallable const &  onClauseBuilder 
)

Constructs an LEFT OUTER JOIN clause with a custom ON clause.

Definition at line 857 of file Core.hpp.

◆ RightOuterJoin() [1/3]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::RightOuterJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
SqlQualifiedTableColumnName  onOtherColumn 
)
inline

Constructs an RIGHT OUTER JOIN clause.

Definition at line 863 of file Core.hpp.

◆ RightOuterJoin() [2/3]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::RightOuterJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
std::string_view  onMainTableColumn 
)
inline

Constructs an RIGHT OUTER JOIN clause.

Definition at line 870 of file Core.hpp.

◆ RightOuterJoin() [3/3]

template<typename Derived >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & Lightweight::SqlWhereClauseBuilder< Derived >::RightOuterJoin ( TableName auto  joinTable,
OnChainCallable const &  onClauseBuilder 
)

Constructs an RIGHT OUTER JOIN clause with a custom ON clause.

Definition at line 880 of file Core.hpp.

◆ FullOuterJoin() [1/3]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::FullOuterJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
SqlQualifiedTableColumnName  onOtherColumn 
)
inline

Constructs an FULL OUTER JOIN clause.

Definition at line 886 of file Core.hpp.

◆ FullOuterJoin() [2/3]

template<typename Derived >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::FullOuterJoin ( TableName auto  joinTable,
std::string_view  joinColumnName,
std::string_view  onMainTableColumn 
)
inline

Constructs an FULL OUTER JOIN clause.

Definition at line 893 of file Core.hpp.

◆ FullOuterJoin() [3/3]

template<typename Derived >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
template<typename OnChainCallable >
requires std::invocable<OnChainCallable, SqlJoinConditionBuilder>
Derived & Lightweight::SqlWhereClauseBuilder< Derived >::FullOuterJoin ( TableName auto  joinTable,
OnChainCallable const &  onClauseBuilder 
)

Constructs an FULL OUTER JOIN clause with a custom ON clause.

Definition at line 903 of file Core.hpp.

◆ Where() [1/5]

template<typename Derived >
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Where ( ColumnName const &  columnName,
T const &  value 
)
inline

Constructs or extends a WHERE clause to test for equality.

Definition at line 586 of file Core.hpp.

◆ OrWhere() [1/3]

template<typename Derived >
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::OrWhere ( ColumnName const &  columnName,
T const &  value 
)
inline

Constructs or extends a WHERE/OR clause to test for equality.

Definition at line 605 of file Core.hpp.

◆ OrWhere() [2/3]

template<typename Derived >
template<typename Callable >
requires std::invocable<Callable, SqlWhereClauseBuilder<Derived>&>
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::OrWhere ( Callable const &  callable)
inline

Constructs or extends a WHERE/OR clause to test for a group of values.

Definition at line 615 of file Core.hpp.

◆ Where() [2/5]

template<typename Derived >
template<typename Callable >
requires std::invocable<Callable, SqlWhereClauseBuilder<Derived>&>
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Where ( Callable const &  callable)
inline

Constructs or extends a WHERE/AND clause to test for a group of values.

Definition at line 624 of file Core.hpp.

◆ WhereIn() [1/3]

template<typename Derived >
template<typename ColumnName , std::ranges::input_range InputRange>
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereIn ( ColumnName const &  columnName,
InputRange const &  values 
)
inline

Constructs or extends a WHERE IN clause with an input range.

Definition at line 649 of file Core.hpp.

◆ WhereIn() [2/3]

template<typename Derived >
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereIn ( ColumnName const &  columnName,
std::initializer_list< T > const &  values 
)
inline

Constructs or extends a WHERE IN clause with an initializer list.

Definition at line 660 of file Core.hpp.

◆ WhereIn() [3/3]

template<typename Derived >
template<typename ColumnName , typename SubSelectQuery >
requires (std::is_invocable_r_v<std::string, decltype(&SubSelectQuery::ToSql), SubSelectQuery const&>)
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereIn ( ColumnName const &  columnName,
SubSelectQuery const &  subSelectQuery 
)
inline

Constructs or extends a WHERE IN clause with a sub-select query.

Definition at line 672 of file Core.hpp.

◆ WhereNotNull()

template<typename Derived >
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereNotNull ( ColumnName const &  columnName)
inline

Constructs or extends a WHERE clause to test for a value being not null.

Definition at line 681 of file Core.hpp.

◆ WhereNull()

template<typename Derived >
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereNull ( ColumnName const &  columnName)
inline

Constructs or extends a WHERE clause to test for a value being null.

Definition at line 689 of file Core.hpp.

◆ WhereNotEqual()

template<typename Derived >
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereNotEqual ( ColumnName const &  columnName,
T const &  value 
)
inline

Constructs or extends a WHERE clause to test for inequality.

Definition at line 697 of file Core.hpp.

◆ WhereTrue()

template<typename Derived >
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereTrue ( ColumnName const &  columnName)
inline

Constructs or extends a WHERE clause to test for a value being true.

Definition at line 709 of file Core.hpp.

◆ WhereFalse()

template<typename Derived >
template<typename ColumnName >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereFalse ( ColumnName const &  columnName)
inline

Constructs or extends a WHERE clause to test for a value being false.

Definition at line 717 of file Core.hpp.

◆ WhereColumn()

template<typename Derived >
template<typename LeftColumn , typename RightColumn >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::WhereColumn ( LeftColumn const &  left,
std::string_view  binaryOp,
RightColumn const &  right 
)
inline

Constructs or extends a WHERE clause to compare two columns.

Definition at line 725 of file Core.hpp.

◆ Where() [3/5]

template<typename Derived >
template<typename ColumnName , std::size_t N>
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Where ( ColumnName const &  columnName,
std::string_view  binaryOp,
char const (&)  value[N] 
)
inline

Constructs or extends a WHERE clause with a string literal value.

Definition at line 750 of file Core.hpp.

◆ Where() [4/5]

template<typename Derived >
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Where ( ColumnName const &  columnName,
std::string_view  binaryOp,
T const &  value 
)
inline

Constructs or extends a WHERE clause to test for a binary operation.

Definition at line 760 of file Core.hpp.

◆ Where() [5/5]

template<typename Derived >
template<typename ColumnName , typename SubSelectQuery >
requires (std::is_invocable_r_v<std::string, decltype(&SubSelectQuery::ToSql), SubSelectQuery const&>)
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Where ( ColumnName const &  columnName,
std::string_view  binaryOp,
SubSelectQuery const &  value 
)
inline

Constructs or extends a WHERE clause with a sub-select query.

Definition at line 780 of file Core.hpp.

◆ OrWhere() [3/3]

template<typename Derived >
template<typename ColumnName , typename T >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::OrWhere ( ColumnName const &  columnName,
std::string_view  binaryOp,
T const &  value 
)
inline

Constructs or extends a WHERE/OR clause with a binary operation.

Definition at line 790 of file Core.hpp.

References Lightweight::SqlWhereClauseBuilder< Derived >::Where().

◆ AppendColumnName()

template<typename Derived >
template<typename ColumnName >
requires (std::same_as<ColumnName, SqlQualifiedTableColumnName> || std::convertible_to<ColumnName, std::string_view> || std::same_as<ColumnName, SqlRawColumnNameView> || std::convertible_to<ColumnName, std::string>)
LIGHTWEIGHT_FORCE_INLINE void Lightweight::SqlWhereClauseBuilder< Derived >::AppendColumnName ( ColumnName const &  columnName)
inline

Appends a column name to the WHERE condition.

Definition at line 967 of file Core.hpp.

◆ AppendLiteralValue()

template<typename Derived >
template<typename LiteralType >
LIGHTWEIGHT_FORCE_INLINE void Lightweight::SqlWhereClauseBuilder< Derived >::AppendLiteralValue ( LiteralType const &  value)
inline

Appends a literal value to the WHERE condition.

Definition at line 975 of file Core.hpp.

◆ PopulateLiteralValueInto()

template<typename Derived >
template<typename LiteralType , typename TargetType >
LIGHTWEIGHT_FORCE_INLINE void Lightweight::SqlWhereClauseBuilder< Derived >::PopulateLiteralValueInto ( LiteralType const &  value,
TargetType &  target 
)
inline

Populates a literal value into the target string.

Definition at line 1007 of file Core.hpp.

◆ Join()

template<typename Derived >
template<typename Callable >
LIGHTWEIGHT_FORCE_INLINE Derived & Lightweight::SqlWhereClauseBuilder< Derived >::Join ( JoinType  joinType,
TableName auto  joinTable,
Callable const &  onClauseBuilder 
)
inline

Constructs a JOIN clause with a custom ON clause builder.

Definition at line 1123 of file Core.hpp.


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