LeechCraft  0.6.70-10870-g558588d6ec
Modular cross-platform feature rich live environment.
oral.h File Reference
#include <stdexcept>
#include <type_traits>
#include <memory>
#include <boost/fusion/include/for_each.hpp>
#include <boost/fusion/include/fold.hpp>
#include <boost/fusion/include/filter_if.hpp>
#include <boost/fusion/container/vector.hpp>
#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/transform.hpp>
#include <boost/fusion/include/zip.hpp>
#include <boost/fusion/container/generation/make_vector.hpp>
#include <boost/variant/variant.hpp>
#include <boost/optional.hpp>
#include <QStringList>
#include <QDateTime>
#include <QPair>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QVariant>
#include <QtDebug>
#include <util/sll/qtutil.h>
#include <util/sll/prelude.h>
#include <util/sll/typelist.h>
#include <util/sll/typelevel.h>
#include <util/sll/typegetter.h>
#include <util/sll/detector.h>
#include <util/sll/unreachable.h>
#include <util/sll/void.h>
#include <util/db/dblock.h>
#include <util/db/util.h>
#include "oraltypes.h"
+ Include dependency graph for oral.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LeechCraft::Util::oral::QueryException
 
struct  LeechCraft::Util::oral::detail::GetFieldName< Seq, Idx >
 
struct  LeechCraft::Util::oral::detail::GetFieldsNames< S >
 
struct  LeechCraft::Util::oral::detail::GetBoundName< Seq, Idx >
 
struct  LeechCraft::Util::oral::detail::AddressOf< S >
 
struct  LeechCraft::Util::oral::Type2Name< T, typename >
 
struct  LeechCraft::Util::oral::Type2Name< Unique< T > >
 
struct  LeechCraft::Util::oral::Type2Name< NotNull< T > >
 
struct  LeechCraft::Util::oral::Type2Name< PKey< T, Tags... > >
 
struct  LeechCraft::Util::oral::Type2Name< PKey< int, Tags... > >
 
struct  LeechCraft::Util::oral::Type2Name< References< Ptr > >
 
struct  LeechCraft::Util::oral::ToVariant< T, typename >
 
struct  LeechCraft::Util::oral::FromVariant< T, typename >
 
struct  LeechCraft::Util::oral::detail::CachedFieldsData
 
struct  LeechCraft::Util::oral::detail::FindPKey< Seq, MemberIdx >
 
struct  LeechCraft::Util::oral::detail::FindPKey< Seq, MemberIdx >::Lazy< T >
 
struct  LeechCraft::Util::oral::detail::AdaptInsert< Seq >
 
struct  LeechCraft::Util::oral::detail::AdaptDelete< Seq, HasPKey >
 
struct  LeechCraft::Util::oral::detail::FieldsUnpacker< HeadT, TailT >
 
struct  LeechCraft::Util::oral::detail::FieldsUnpacker< HeadT >
 
struct  LeechCraft::Util::oral::detail::ValueBinder< FieldsUnpacker, HeadArg, TailArgs >
 
struct  LeechCraft::Util::oral::detail::ValueBinder< FieldsUnpacker, HeadArg >
 
struct  LeechCraft::Util::oral::detail::ToSqlState< T >
 
struct  LeechCraft::Util::oral::detail::WrapDirect< T >
 
struct  LeechCraft::Util::oral::detail::RelationalTypesCheckerBase< Seq, L, R, typename >
 
struct  LeechCraft::Util::oral::detail::RelationalTypesCheckerBase< Seq, L, R, std::enable_if_t< AreComparableTypes< Seq, L, R > > >
 
struct  LeechCraft::Util::oral::detail::RelationalTypesChecker< Type, Seq, L, R, typename >
 
struct  LeechCraft::Util::oral::detail::RelationalTypesChecker< Type, Seq, L, R, std::enable_if_t< IsRelational(Type)> >
 
class  LeechCraft::Util::oral::detail::ExprTree< Type, L, R >
 
struct  LeechCraft::Util::oral::detail::IsExprTree< T >
 
struct  LeechCraft::Util::oral::detail::IsExprTree< ExprTree< Type, L, R > >
 
class  LeechCraft::Util::oral::detail::AssignList< L, R >
 
class  LeechCraft::Util::oral::detail::ExprTree< Type, L, R >
 
class  LeechCraft::Util::oral::detail::ExprTree< ExprType::LeafStaticPlaceholder, boost::mpl::int_< Idx >, void >
 
struct  LeechCraft::Util::oral::detail::MemberPtrs< Ptr >
 
class  LeechCraft::Util::oral::detail::ExprTree< ExprType::LeafStaticPlaceholder, MemberPtrs< Ptr >, void >
 
class  LeechCraft::Util::oral::detail::ExprTree< ExprType::LeafData, T, void >
 
class  LeechCraft::Util::oral::detail::ExprTree< ExprType::ConstTrue, void, void >
 
struct  LeechCraft::Util::oral::detail::AggregateType< AggregateFunction >
 
class  LeechCraft::Util::oral::detail::SelectWrapper< T, SelectBehaviour >
 
class  LeechCraft::Util::oral::detail::DeleteByFieldsWrapper< T >
 
class  LeechCraft::Util::oral::detail::AdaptUpdate< T, HasPKey >
 
struct  LeechCraft::Util::oral::detail::ConstraintToString< T >
 
struct  LeechCraft::Util::oral::detail::ConstraintToString< UniqueSubset< Fields... > >
 
struct  LeechCraft::Util::oral::detail::ConstraintToString< PrimaryKey< Fields... > >
 
struct  LeechCraft::Util::oral::ObjectInfo< T >
 

Namespaces

 LeechCraft
 
 LeechCraft::Util
 
 LeechCraft::Util::oral
 
 LeechCraft::Util::oral::detail
 
 LeechCraft::Util::oral::sph
 

Typedefs

using QSqlQuery_ptr = std::shared_ptr< QSqlQuery >
 
template<typename U >
using LeechCraft::Util::oral::detail::MorpherDetector = decltype(std::declval< U >().FieldNameMorpher(QString {}))
 
template<typename Seq , int Idx>
using LeechCraft::Util::oral::detail::ValueAtC_t = typename boost::fusion::result_of::value_at_c< Seq, Idx >::type
 
template<typename Seq , typename Idx >
using LeechCraft::Util::oral::detail::ValueAt_t = typename boost::fusion::result_of::value_at< Seq, Idx >::type
 
template<typename Seq >
using LeechCraft::Util::oral::detail::FindPKeyDetector = boost::mpl::int_< FindPKey< Seq >::result_type::value >
 
template<typename T , typename... Args>
using LeechCraft::Util::oral::detail::AggregateDetector_t = decltype(new T { std::declval< Args >()... })
 
template<typename T >
using LeechCraft::Util::oral::detail::UnwrapIndirect_t = typename std::conditional_t< IsIndirect< T > {}, T, WrapDirect< T > >::value_type
 
template<typename Seq , typename L , typename R >
using LeechCraft::Util::oral::detail::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 LeechCraft::Util::oral::detail::EnableRelOp_t = std::enable_if_t< AnyOf< IsExprTree, L, R > >
 
template<int Idx>
using LeechCraft::Util::oral::sph::pos = detail::ExprTree< detail::ExprType::LeafStaticPlaceholder, boost::mpl::int_< Idx > >
 
template<typename T >
using LeechCraft::Util::oral::detail::ConstraintsDetector = typename T::Constraints
 
template<typename T >
using LeechCraft::Util::oral::detail::ConstraintsType = Util::IsDetected_t< Constraints<>, ConstraintsDetector, T >
 
template<typename T >
using LeechCraft::Util::oral::ObjectInfo_ptr = std::shared_ptr< ObjectInfo< T > >
 

Enumerations

enum  LeechCraft::Util::oral::InsertAction {
  LeechCraft::Util::oral::InsertAction::Default,
  LeechCraft::Util::oral::InsertAction::Ignore,
  LeechCraft::Util::oral::InsertAction::Replace
}
 
enum  LeechCraft::Util::oral::detail::ExprType {
  LeechCraft::Util::oral::detail::ExprType::ConstTrue,
  LeechCraft::Util::oral::detail::ExprType::LeafStaticPlaceholder,
  LeechCraft::Util::oral::detail::ExprType::LeafData,
  LeechCraft::Util::oral::detail::ExprType::Greater,
  LeechCraft::Util::oral::detail::ExprType::Less,
  LeechCraft::Util::oral::detail::ExprType::Equal,
  LeechCraft::Util::oral::detail::ExprType::Geq,
  LeechCraft::Util::oral::detail::ExprType::Leq,
  LeechCraft::Util::oral::detail::ExprType::Neq,
  LeechCraft::Util::oral::detail::ExprType::And,
  LeechCraft::Util::oral::detail::ExprType::Or
}
 
enum  LeechCraft::Util::oral::detail::AggregateFunction { LeechCraft::Util::oral::detail::AggregateFunction::Count }
 
enum  LeechCraft::Util::oral::detail::SelectBehaviour {
  LeechCraft::Util::oral::detail::SelectBehaviour::Some,
  LeechCraft::Util::oral::detail::SelectBehaviour::One
}
 

Functions

template<typename T >
QString LeechCraft::Util::oral::detail::MorphFieldName (QString str)
 
template<auto Ptr, size_t Idx = 0>
constexpr size_t LeechCraft::Util::oral::detail::FieldIndex ()
 
template<typename T >
QVariant LeechCraft::Util::oral::detail::ToVariantF (const T &t)
 
template<typename T >
CachedFieldsData LeechCraft::Util::oral::detail::BuildCachedFieldsData (const QString &table)
 
template<typename T >
CachedFieldsData LeechCraft::Util::oral::detail::BuildCachedFieldsData ()
 
template<typename T >
auto LeechCraft::Util::oral::detail::MakeInserter (const CachedFieldsData &data, const QSqlQuery_ptr &insertQuery, bool bindPrimaryKey)
 
template<typename Seq >
constexpr auto LeechCraft::Util::oral::detail::HasAutogenPKey ()
 
QString LeechCraft::Util::oral::detail::GetInsertPrefix (InsertAction action)
 
template<typename T , size_t... Indices>
LeechCraft::Util::oral::detail::InitializeFromQuery (const QSqlQuery &q, std::index_sequence< Indices... >)
 
QString LeechCraft::Util::oral::detail::TypeToSql (ExprType type)
 
constexpr bool LeechCraft::Util::oral::detail::IsRelational (ExprType type)
 
template<typename T >
constexpr auto LeechCraft::Util::oral::detail::AsLeafData (const T &node)
 
template<ExprType Type, typename L , typename R >
ExprTree< Type, L, R > LeechCraft::Util::oral::detail::MakeExprTree (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator< (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator> (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator== (const L &left, const R &right)
 
template<typename L , typename R , typename = EnableRelOp_t<L, R>>
auto LeechCraft::Util::oral::detail::operator && (const L &left, const R &right)
 
template<typename >
auto LeechCraft::Util::oral::detail::HandleExprTree (const ExprTree< ExprType::ConstTrue > &, int lastId=0)
 
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)
 
template<auto... Ptrs, size_t... Idxs>
auto LeechCraft::Util::oral::detail::MakeIndexedQueryHandler (detail::MemberPtrs< Ptrs... >, std::index_sequence< Idxs... >)
 
template<auto... Ptrs>
QStringList LeechCraft::Util::oral::detail::BuildFieldNames ()
 
template<typename... Args>
QStringList LeechCraft::Util::oral::detail::GetConstraintsStringList (Constraints< Args... >, const CachedFieldsData &data)
 
template<typename T , size_t... Indices>
QList< QString > LeechCraft::Util::oral::detail::GetTypes (std::index_sequence< Indices... >)
 
template<typename T >
QString LeechCraft::Util::oral::detail::AdaptCreateTable (const CachedFieldsData &data)
 
template<typename T >
ObjectInfo< T > LeechCraft::Util::oral::Adapt (const QSqlDatabase &db)
 
template<typename T >
ObjectInfo_ptr< T > LeechCraft::Util::oral::AdaptPtr (const QSqlDatabase &db)
 

Variables

template<typename S >
constexpr auto LeechCraft::Util::oral::detail::SeqSize = boost::fusion::result_of::size<S>::type::value
 
template<typename S >
constexpr auto LeechCraft::Util::oral::detail::SeqIndices = std::make_index_sequence<SeqSize<S>> {}
 
constexpr size_t LeechCraft::Util::oral::InsertActionCount = 3
 
template<typename Seq >
constexpr auto LeechCraft::Util::oral::detail::HasPKey = IsDetected_v<FindPKeyDetector, Seq>
 
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>
 
constexpr auto LeechCraft::Util::oral::detail::ConstTrueTree_v = ExprTree<ExprType::ConstTrue> {}
 
template<typename L , typename R >
constexpr auto LeechCraft::Util::oral::detail::AllTrees_v = AllOf<IsExprTree, L, R>
 
template<auto Ptr>
constexpr detail::ExprTree< detail::ExprType::LeafStaticPlaceholder, detail::MemberPtrs< Ptr > > LeechCraft::Util::oral::sph::f {}
 
template<auto... Ptrs>
constexpr detail::MemberPtrs< Ptrs... > LeechCraft::Util::oral::sph::fields {}
 
constexpr detail::AggregateType< detail::AggregateFunction::Count > LeechCraft::Util::oral::sph::count {}
 

Typedef Documentation

◆ QSqlQuery_ptr

using QSqlQuery_ptr = std::shared_ptr<QSqlQuery>

Definition at line 65 of file oral.h.