ORM C++
Loading...
Searching...
No Matches
orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join > Class Template Referenceexport
module orm

Public Types

using Model = Owner
using Result = ResultType
using State = StateTuple
using ParameterTypes = detail::ParameterTypes<State>
using Predicate = std::tuple_element_t<0, State>
using Orders = std::tuple_element_t<1, State>
using Groups = std::tuple_element_t<2, State>
using Having = std::tuple_element_t<3, State>
using Projections = std::tuple_element_t<4, State>
using Assignments = std::tuple_element_t<5, State>
using Limit = std::tuple_element_t<6, State>
using Offset = std::tuple_element_t<7, State>
using Includes = std::tuple_element_t<8, State>

Public Member Functions

template<typename P>
constexpr auto where (P predicate) const
template<typename P>
constexpr auto andWhere (P predicate) const
template<typename P>
constexpr auto orWhere (P predicate) const
template<typename... O>
constexpr auto orderBy (O... orders) const
template<typename... C>
constexpr auto groupBy (C... columns) const
template<typename P>
constexpr auto having (P predicate) const
template<typename P>
constexpr auto andHaving (P predicate) const
template<typename P>
constexpr auto orHaving (P predicate) const
template<typename... P>
constexpr auto project (P... projections) const
constexpr auto distinct () const
constexpr auto disableJoining () const
constexpr auto limit (std::size_t value) const
constexpr auto offset (std::size_t value) const
template<std::size_t I>
constexpr auto limit (Parameter< std::size_t, I > value) const
template<std::size_t I>
constexpr auto offset (Parameter< std::size_t, I > value) const
template<auto Member>
constexpr auto include () const
template<auto... Members, typename V>
constexpr auto set (TypedColumn< Members... >, V &&value) const
template<typename... Args>
auto toDynamic (Args &&... values) const

Static Public Member Functions

static consteval auto validateShape () -> void

Static Public Attributes

static constexpr auto operation = Operation
static constexpr bool isDistinct = Distinct
static constexpr bool shouldJoin = Join
static constexpr bool isProjection = !std::same_as<Projections, std::tuple<>>
static constexpr bool hasPredicate = !std::same_as<Predicate, detail::NoClause>
static constexpr bool hasHaving = !std::same_as<Having, detail::NoClause>
static constexpr bool hasLimit = !std::same_as<Limit, detail::NoClause>
static constexpr bool hasOffset = !std::same_as<Offset, detail::NoClause>

Friends

struct detail::PlanAccess

Detailed Description

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
class orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >

An immutable, reusable query shape. Values are owned and bound at execution.

Definition at line 96 of file static_plan.cppm.

Member Typedef Documentation

◆ Assignments

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Assignments = std::tuple_element_t<5, State>

Definition at line 108 of file static_plan.cppm.

◆ Groups

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Groups = std::tuple_element_t<2, State>

Definition at line 105 of file static_plan.cppm.

◆ Having

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Having = std::tuple_element_t<3, State>

Definition at line 106 of file static_plan.cppm.

◆ Includes

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Includes = std::tuple_element_t<8, State>

Definition at line 111 of file static_plan.cppm.

◆ Limit

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Limit = std::tuple_element_t<6, State>

Definition at line 109 of file static_plan.cppm.

◆ Model

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Model = Owner

Definition at line 99 of file static_plan.cppm.

◆ Offset

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Offset = std::tuple_element_t<7, State>

Definition at line 110 of file static_plan.cppm.

◆ Orders

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Orders = std::tuple_element_t<1, State>

Definition at line 104 of file static_plan.cppm.

◆ ParameterTypes

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::ParameterTypes = detail::ParameterTypes<State>

Definition at line 102 of file static_plan.cppm.

◆ Predicate

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Predicate = std::tuple_element_t<0, State>

Definition at line 103 of file static_plan.cppm.

◆ Projections

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Projections = std::tuple_element_t<4, State>

Definition at line 107 of file static_plan.cppm.

◆ Result

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::Result = ResultType

Definition at line 100 of file static_plan.cppm.

◆ State

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
using orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::State = StateTuple

Definition at line 101 of file static_plan.cppm.

Member Function Documentation

◆ andHaving()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename P>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::andHaving ( P predicate) const
inlineconstexpr

Definition at line 168 of file static_plan.cppm.

◆ andWhere()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename P>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::andWhere ( P predicate) const
inlineconstexpr

Definition at line 131 of file static_plan.cppm.

◆ disableJoining()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::disableJoining ( ) const
inlineconstexpr

Definition at line 198 of file static_plan.cppm.

◆ distinct()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::distinct ( ) const
inlineconstexpr

Definition at line 193 of file static_plan.cppm.

◆ groupBy()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename... C>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::groupBy ( C... columns) const
inlineconstexpr

Definition at line 156 of file static_plan.cppm.

◆ having()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename P>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::having ( P predicate) const
inlineconstexpr

Definition at line 162 of file static_plan.cppm.

◆ include()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<auto Member>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::include ( ) const
inlineconstexpr

Definition at line 229 of file static_plan.cppm.

◆ limit() [1/2]

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<std::size_t I>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::limit ( Parameter< std::size_t, I > value) const
inlineconstexpr

Definition at line 214 of file static_plan.cppm.

◆ limit() [2/2]

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::limit ( std::size_t value) const
inlineconstexpr

Definition at line 203 of file static_plan.cppm.

◆ offset() [1/2]

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<std::size_t I>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::offset ( Parameter< std::size_t, I > value) const
inlineconstexpr

Definition at line 220 of file static_plan.cppm.

◆ offset() [2/2]

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::offset ( std::size_t value) const
inlineconstexpr

Definition at line 208 of file static_plan.cppm.

◆ orderBy()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename... O>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::orderBy ( O... orders) const
inlineconstexpr

Definition at line 150 of file static_plan.cppm.

◆ orHaving()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename P>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::orHaving ( P predicate) const
inlineconstexpr

Definition at line 177 of file static_plan.cppm.

◆ orWhere()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename P>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::orWhere ( P predicate) const
inlineconstexpr

Definition at line 141 of file static_plan.cppm.

◆ project()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename... P>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::project ( P... projections) const
inlineconstexpr

Definition at line 188 of file static_plan.cppm.

◆ set()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<auto... Members, typename V>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::set ( TypedColumn< Members... > ,
V && value ) const
inlineconstexpr

Definition at line 243 of file static_plan.cppm.

◆ toDynamic()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename... Args>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::toDynamic ( Args &&... values) const
inline

Definition at line 258 of file static_plan.cppm.

◆ validateShape()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
consteval auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::validateShape ( ) -> void
inlinestaticconsteval

Definition at line 249 of file static_plan.cppm.

◆ where()

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
template<typename P>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::where ( P predicate) const
inlineconstexpr

Definition at line 124 of file static_plan.cppm.

◆ detail::PlanAccess

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
friend struct detail::PlanAccess
friend

Definition at line 310 of file static_plan.cppm.

Member Data Documentation

◆ hasHaving

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
bool orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::hasHaving = !std::same_as<Having, detail::NoClause>
inlinestaticconstexpr

Definition at line 117 of file static_plan.cppm.

◆ hasLimit

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
bool orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::hasLimit = !std::same_as<Limit, detail::NoClause>
inlinestaticconstexpr

Definition at line 118 of file static_plan.cppm.

◆ hasOffset

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
bool orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::hasOffset = !std::same_as<Offset, detail::NoClause>
inlinestaticconstexpr

Definition at line 119 of file static_plan.cppm.

◆ hasPredicate

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
bool orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::hasPredicate = !std::same_as<Predicate, detail::NoClause>
inlinestaticconstexpr

Definition at line 116 of file static_plan.cppm.

◆ isDistinct

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
bool orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::isDistinct = Distinct
inlinestaticconstexpr

Definition at line 113 of file static_plan.cppm.

◆ isProjection

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
bool orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::isProjection = !std::same_as<Projections, std::tuple<>>
inlinestaticconstexpr

Definition at line 115 of file static_plan.cppm.

◆ operation

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
auto orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::operation = Operation
inlinestaticconstexpr

Definition at line 112 of file static_plan.cppm.

◆ shouldJoin

template<detail::PlanOperation Operation, typename Owner, typename ResultType, typename StateTuple, bool Distinct = false, bool Join = true>
bool orm::query::StaticPlan< Operation, Owner, ResultType, StateTuple, Distinct, Join >::shouldJoin = Join
inlinestaticconstexpr

Definition at line 114 of file static_plan.cppm.


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