LeechCraft  0.6.70-11552-gf61ee51c3d
Modular cross-platform feature rich live environment.
LeechCraft::Util::oral::detail Namespace Reference

Namespaces

 PostgreSQL
 
 SQLite
 

Classes

struct  AdaptDelete
 
class  AdaptInsert
 
class  AdaptUpdate
 
struct  AddressOf
 
struct  AggregateType
 
class  AssignList
 
struct  CachedFieldsData
 
class  DeleteByFieldsWrapper
 
class  ExprTree
 
class  ExprTree< ExprType::ConstTrue, void, void >
 
class  ExprTree< ExprType::LeafData, T, void >
 
class  ExprTree< ExprType::LeafStaticPlaceholder, boost::mpl::int_< Idx >, void >
 
class  ExprTree< ExprType::LeafStaticPlaceholder, MemberPtrs< Ptr >, void >
 
struct  ExtractConstraintFields
 
struct  ExtractConstraintFields< PrimaryKey< Fields... > >
 
struct  ExtractConstraintFields< UniqueSubset< Fields... > >
 
struct  FieldsUnpacker
 
struct  FieldsUnpacker< HeadT >
 
struct  FindPKey
 
struct  GetBoundName
 
struct  GetFieldName
 
struct  GetFieldsNames
 
class  IInsertQueryBuilder
 
struct  IsExprTree
 
struct  IsExprTree< ExprTree< Type, L, R > >
 
struct  IsPKey
 
struct  IsPKey< PKey< U, Tags... > >
 
struct  IsReferencesTarget
 
struct  IsReferencesTarget< PKey< U, Tags... > >
 
struct  IsReferencesTarget< Unique< U > >
 
struct  MemberPtrs
 
struct  RelationalTypesChecker
 
struct  RelationalTypesChecker< Type, Seq, L, R, std::enable_if_t< IsRelational(Type)> >
 
struct  RelationalTypesCheckerBase
 
struct  RelationalTypesCheckerBase< Seq, L, R, std::enable_if_t< AreComparableTypes< Seq, L, R > > >
 
class  SelectWrapper
 
struct  ToSqlState
 
struct  ValueBinder
 
struct  ValueBinder< FieldsUnpacker, HeadArg >
 
struct  WrapDirect
 

Typedefs

using IInsertQueryBuilder_ptr = std::unique_ptr< IInsertQueryBuilder >
 
template<typename U >
using MorpherDetector = decltype(std::declval< U >().FieldNameMorpher(QString{}))
 
template<typename Seq , int Idx>
using ValueAtC_t = typename boost::fusion::result_of::value_at_c< Seq, Idx >::type
 
template<typename Seq , typename Idx >
using ValueAt_t = typename boost::fusion::result_of::value_at< Seq, Idx >::type
 
template<typename Seq >
using FindPKeyDetector = boost::mpl::int_< FindPKey< Seq >::result_type::value >
 
template<typename T , typename... Args>
using AggregateDetector_t = decltype(new T{std::declval< Args >()...})
 
template<typename T >
using UnwrapIndirect_t = typename std::conditional_t< IsIndirect< T >{}, T, WrapDirect< T >>::value_type
 
template<typename Seq , typename L , typename R >
using ComparableDetector = decltype(std::declval< UnwrapIndirect_t< typename L::template ValueType_t< Seq >>>()==std::declval< UnwrapIndirect_t< typename R::template ValueType_t< Seq >>>())
 
template<typename L , typename R >
using EnableRelOp_t = std::enable_if_t< AnyOf< IsExprTree, L, R >>
 
template<typename T >
using ConstraintsDetector = typename T::Constraints
 
template<typename T >
using ConstraintsType = Util::IsDetected_t< Constraints<>, ConstraintsDetector, T >
 

Enumerations

enum  ExprType {
  ExprType::ConstTrue,
  ExprType::LeafStaticPlaceholder,
  ExprType::LeafData,
  ExprType::Greater,
  ExprType::Less,
  ExprType::Equal,
  ExprType::Geq,
  ExprType::Leq,
  ExprType::Neq,
  ExprType::And,
  ExprType::Or
}
 
enum  AggregateFunction { AggregateFunction::Count }
 
enum  SelectBehaviour {
  SelectBehaviour::Some,
  SelectBehaviour::One
}
 

Functions

bool MatchesSchema (const QString &baseName, const QString &schema, QSqlDatabase &db)
 
template<typename T >
QString MorphFieldName (QString str)
 
template<auto Ptr, size_t Idx = 0>
constexpr size_t FieldIndex ()
 
template<typename T >
QVariant ToVariantF (const T &t)
 
template<typename T >
auto MakeInserter (const CachedFieldsData &data, const QSqlQuery_ptr &insertQuery, bool bindPrimaryKey)
 
template<typename Seq >
constexpr auto HasAutogenPKey ()
 
template<typename T >
CachedFieldsData BuildCachedFieldsData (const QString &table)
 
template<typename T >
CachedFieldsData BuildCachedFieldsData ()
 
template<typename T , size_t... Indices>
T InitializeFromQuery (const QSqlQuery &q, std::index_sequence< Indices... >)
 
QString TypeToSql (ExprType type)
 
constexpr bool IsRelational (ExprType type)
 
template<typename T >
constexpr auto AsLeafData (const T &node)
 
template<ExprType Type, typename L , typename R >
ExprTree< Type, L, R > MakeExprTree (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto operator< (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto operator> (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto operator== (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto operator&& (const L &left, const R &right)
 
template<typename >
auto HandleExprTree (const ExprTree< ExprType::ConstTrue > &, int lastId=0)
 
template<typename Seq , typename Tree , typename = decltype (std::declval<Tree> ().ToSql (std::declval<ToSqlState<Seq>&> ()))>
auto HandleExprTree (const Tree &tree, int lastId=0)
 
template<auto... Ptrs, size_t... Idxs>
auto MakeIndexedQueryHandler (detail::MemberPtrs< Ptrs... >, std::index_sequence< Idxs... >)
 
template<auto... Ptrs>
QStringList BuildFieldNames ()
 
template<typename... Args>
QStringList GetConstraintsStringList (Constraints< Args... >, const CachedFieldsData &data)
 
template<typename ImplFactory , typename T , size_t... Indices>
QList< QString > GetTypes (std::index_sequence< Indices... >)
 
template<typename ImplFactory , typename T >
QString AdaptCreateTable (const CachedFieldsData &data)
 

Variables

template<typename S >
constexpr auto SeqSize = boost::fusion::result_of::size<S>::type::value
 
template<typename S >
constexpr auto SeqIndices = std::make_index_sequence<SeqSize<S>> {}
 
template<typename Seq >
constexpr auto HasPKey = IsDetected_v<FindPKeyDetector, Seq>
 
template<typename Seq , typename L , typename R >
constexpr auto AreComparableTypes = IsDetected_v<ComparableDetector, Seq, L, R> || IsDetected_v<ComparableDetector, Seq, R, L>
 
constexpr auto ConstTrueTree_v = ExprTree<ExprType::ConstTrue> {}
 
template<typename L , typename R >
constexpr auto AllTrees_v = AllOf<IsExprTree, L, R>
 

Typedef Documentation

template<typename T , typename... Args>
using LeechCraft::Util::oral::detail::AggregateDetector_t = typedef decltype (new T { std::declval<Args> ()... })

Definition at line 471 of file oral.h.

template<typename Seq , typename L , typename R >
using LeechCraft::Util::oral::detail::ComparableDetector = typedef decltype (std::declval<UnwrapIndirect_t<typename L::template ValueType_t<Seq>>> () == std::declval<UnwrapIndirect_t<typename R::template ValueType_t<Seq>>> ())

Definition at line 608 of file oral.h.

template<typename T >
using LeechCraft::Util::oral::detail::ConstraintsDetector = typedef typename T::Constraints

Definition at line 1140 of file oral.h.

Definition at line 1143 of file oral.h.

template<typename L , typename R >
using LeechCraft::Util::oral::detail::EnableRelOp_t = typedef std::enable_if_t<AnyOf<IsExprTree, L, R>>

Definition at line 804 of file oral.h.

template<typename Seq >
using LeechCraft::Util::oral::detail::FindPKeyDetector = typedef boost::mpl::int_<FindPKey<Seq>::result_type::value>

Definition at line 343 of file oral.h.

Definition at line 48 of file impldefs.h.

template<typename U >
using LeechCraft::Util::oral::detail::MorpherDetector = typedef decltype (std::declval<U> ().FieldNameMorpher (QString {}))

Definition at line 104 of file oral.h.

template<typename T >
using LeechCraft::Util::oral::detail::UnwrapIndirect_t = typedef typename std::conditional_t<IsIndirect<T> {}, T, WrapDirect<T>>::value_type

Definition at line 604 of file oral.h.

template<typename Seq , typename Idx >
using LeechCraft::Util::oral::detail::ValueAt_t = typedef typename boost::fusion::result_of::value_at<Seq, Idx>::type

Definition at line 321 of file oral.h.

template<typename Seq , int Idx>
using LeechCraft::Util::oral::detail::ValueAtC_t = typedef typename boost::fusion::result_of::value_at_c<Seq, Idx>::type

Definition at line 318 of file oral.h.

Enumeration Type Documentation

Enumerator
Count 

Definition at line 871 of file oral.h.

Enumerator
ConstTrue 
LeafStaticPlaceholder 
LeafData 
Greater 
Less 
Equal 
Geq 
Leq 
Neq 
And 
Or 

Definition at line 530 of file oral.h.

Enumerator
Some 
One 

Definition at line 920 of file oral.h.

Function Documentation

template<typename ImplFactory , typename T >
QString LeechCraft::Util::oral::detail::AdaptCreateTable ( const CachedFieldsData &  data)
template<typename T >
constexpr auto LeechCraft::Util::oral::detail::AsLeafData ( const T &  node)
template<typename T >
CachedFieldsData LeechCraft::Util::oral::detail::BuildCachedFieldsData ( const QString &  table)

Definition at line 358 of file oral.h.

References LeechCraft::Util::oral::sph::fields, and LeechCraft::Util::Map().

+ Here is the call graph for this function:

template<typename T >
CachedFieldsData LeechCraft::Util::oral::detail::BuildCachedFieldsData ( )

Definition at line 368 of file oral.h.

template<auto... Ptrs>
QStringList LeechCraft::Util::oral::detail::BuildFieldNames ( )

Definition at line 915 of file oral.h.

Referenced by LeechCraft::Util::oral::detail::SelectWrapper< T, detail::SelectBehaviour::One >::operator()().

+ Here is the caller graph for this function:

template<auto Ptr, size_t Idx = 0>
constexpr size_t LeechCraft::Util::oral::detail::FieldIndex ( )

Definition at line 174 of file oral.h.

template<typename... Args>
QStringList LeechCraft::Util::oral::detail::GetConstraintsStringList ( Constraints< Args... >  ,
const CachedFieldsData &  data 
)

Definition at line 1167 of file oral.h.

Referenced by AdaptCreateTable().

+ Here is the caller graph for this function:

template<typename ImplFactory , typename T , size_t... Indices>
QList<QString> LeechCraft::Util::oral::detail::GetTypes ( std::index_sequence< Indices... >  )

Definition at line 1173 of file oral.h.

template<typename >
auto LeechCraft::Util::oral::detail::HandleExprTree ( const ExprTree< ExprType::ConstTrue > &  ,
int  lastId = 0 
)

Definition at line 846 of file oral.h.

template<typename Seq , typename Tree , typename = decltype (std::declval<Tree> ().ToSql (std::declval<ToSqlState<Seq>&> ()))>
auto LeechCraft::Util::oral::detail::HandleExprTree ( const Tree &  tree,
int  lastId = 0 
)

Definition at line 853 of file oral.h.

References LeechCraft::Util::oral::detail::ToSqlState< T >::LastID_, and LeechCraft::Util::Stlize().

+ Here is the call graph for this function:

template<typename Seq >
constexpr auto LeechCraft::Util::oral::detail::HasAutogenPKey ( )

Definition at line 349 of file oral.h.

template<typename T , size_t... Indices>
T LeechCraft::Util::oral::detail::InitializeFromQuery ( const QSqlQuery &  q,
std::index_sequence< Indices... >   
)

Definition at line 474 of file oral.h.

References LeechCraft::Util::IsDetected_v.

constexpr bool LeechCraft::Util::oral::detail::IsRelational ( ExprType  type)

Definition at line 578 of file oral.h.

template<ExprType Type, typename L , typename R >
ExprTree<Type, L, R> LeechCraft::Util::oral::detail::MakeExprTree ( const L &  left,
const R &  right 
)

Definition at line 798 of file oral.h.

template<auto... Ptrs, size_t... Idxs>
auto LeechCraft::Util::oral::detail::MakeIndexedQueryHandler ( detail::MemberPtrs< Ptrs... >  ,
std::index_sequence< Idxs... >   
)

Definition at line 903 of file oral.h.

Referenced by LeechCraft::Util::oral::detail::SelectWrapper< T, detail::SelectBehaviour::One >::operator()().

+ Here is the caller graph for this function:

template<typename T >
auto LeechCraft::Util::oral::detail::MakeInserter ( const CachedFieldsData &  data,
const QSqlQuery_ptr &  insertQuery,
bool  bindPrimaryKey 
)
bool LeechCraft::Util::oral::detail::MatchesSchema ( const QString &  baseName,
const QString &  schema,
QSqlDatabase &  db 
)

Definition at line 42 of file migrate.h.

References LeechCraft::Util::RunTextQuery().

Referenced by LeechCraft::Util::oral::Migrate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldName ( QString  str)

Definition at line 107 of file oral.h.

template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator&& ( const L &  left,
const R &  right 
)

Definition at line 837 of file oral.h.

References AsLeafData().

+ Here is the call graph for this function:

template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator< ( const L &  left,
const R &  right 
)

Definition at line 810 of file oral.h.

References AsLeafData().

+ Here is the call graph for this function:

template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator== ( const L &  left,
const R &  right 
)

Definition at line 828 of file oral.h.

References AsLeafData().

+ Here is the call graph for this function:

template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator> ( const L &  left,
const R &  right 
)

Definition at line 819 of file oral.h.

References AsLeafData().

+ Here is the call graph for this function:

template<typename T >
QVariant LeechCraft::Util::oral::detail::ToVariantF ( const T &  t)
QString LeechCraft::Util::oral::detail::TypeToSql ( ExprType  type)
inline

Definition at line 548 of file oral.h.

References LeechCraft::Util::Unreachable().

Referenced by LeechCraft::Util::oral::detail::ExprTree< Type, L, R >::ToSql().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

template<typename L , typename R >
constexpr auto LeechCraft::Util::oral::detail::AllTrees_v = AllOf<IsExprTree, L, R>

Definition at line 807 of file oral.h.

template<typename Seq , typename L , typename R >
constexpr auto LeechCraft::Util::oral::detail::AreComparableTypes = IsDetected_v<ComparableDetector, Seq, L, R> || IsDetected_v<ComparableDetector, Seq, R, L>

Definition at line 611 of file oral.h.

constexpr auto LeechCraft::Util::oral::detail::ConstTrueTree_v = ExprTree<ExprType::ConstTrue> {}
template<typename Seq >
constexpr auto LeechCraft::Util::oral::detail::HasPKey = IsDetected_v<FindPKeyDetector, Seq>

Definition at line 346 of file oral.h.

template<typename S >
constexpr auto LeechCraft::Util::oral::detail::SeqIndices = std::make_index_sequence<SeqSize<S>> {}

Definition at line 132 of file oral.h.

template<typename S >
constexpr auto LeechCraft::Util::oral::detail::SeqSize = boost::fusion::result_of::size<S>::type::value

Definition at line 129 of file oral.h.