mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
SelectTest compiles again
This commit is contained in:
parent
b00fe51fed
commit
3fb6c6c246
@ -62,6 +62,7 @@ namespace sqlpp
|
||||
template<typename Db = void, typename... Policies>
|
||||
struct select_policies_t
|
||||
{
|
||||
#warning need to check policies' signature, e.g. a _data_t in _member_t template
|
||||
using _database_t = Db;
|
||||
using _statement_t = select_t<Db, Policies...>;
|
||||
|
||||
|
2
include/sqlpp11/vendor/group_by.h
vendored
2
include/sqlpp11/vendor/group_by.h
vendored
@ -73,7 +73,7 @@ namespace sqlpp
|
||||
static_assert(::sqlpp::detail::all_t<is_expression_t<Expressions>::value...>::value, "at least one argument is not an expression in group_by()");
|
||||
|
||||
// Data
|
||||
using _data_t = select_flag_list_data_t<Database, Expressions...>;
|
||||
using _data_t = group_by_data_t<Database, Expressions...>;
|
||||
|
||||
// Member implementation with data and methods
|
||||
template<typename Policies>
|
||||
|
6
include/sqlpp11/vendor/limit.h
vendored
6
include/sqlpp11/vendor/limit.h
vendored
@ -75,6 +75,8 @@ namespace sqlpp
|
||||
template<typename Policies>
|
||||
struct _member_t
|
||||
{
|
||||
using _data_t = limit_data_t<Limit>;
|
||||
|
||||
_impl_t<Policies> limit;
|
||||
_impl_t<Policies>& operator()() { return limit; }
|
||||
const _impl_t<Policies>& operator()() const { return limit; }
|
||||
@ -126,7 +128,7 @@ namespace sqlpp
|
||||
using _recursive_traits = make_recursive_traits<>;
|
||||
|
||||
// Data
|
||||
using _data_t = limit_data_t<Database>;
|
||||
using _data_t = dynamic_limit_data_t<Database>;
|
||||
|
||||
// Member implementation with data and methods
|
||||
template <typename Policies>
|
||||
@ -148,6 +150,8 @@ namespace sqlpp
|
||||
template<typename Policies>
|
||||
struct _member_t
|
||||
{
|
||||
using _data_t = dynamic_limit_data_t<Database>;
|
||||
|
||||
_impl_t<Policies> limit;
|
||||
_impl_t<Policies>& operator()() { return limit; }
|
||||
const _impl_t<Policies>& operator()() const { return limit; }
|
||||
|
6
include/sqlpp11/vendor/offset.h
vendored
6
include/sqlpp11/vendor/offset.h
vendored
@ -75,6 +75,8 @@ namespace sqlpp
|
||||
template<typename Policies>
|
||||
struct _member_t
|
||||
{
|
||||
using _data_t = offset_data_t<Offset>;
|
||||
|
||||
_impl_t<Policies> offset;
|
||||
_impl_t<Policies>& operator()() { return offset; }
|
||||
const _impl_t<Policies>& operator()() const { return offset; }
|
||||
@ -126,7 +128,7 @@ namespace sqlpp
|
||||
using _recursive_traits = make_recursive_traits<>;
|
||||
|
||||
// Data
|
||||
using _data_t = offset_data_t<Database>;
|
||||
using _data_t = dynamic_offset_data_t<Database>;
|
||||
|
||||
// Member implementation with data and methods
|
||||
template <typename Policies>
|
||||
@ -148,6 +150,8 @@ namespace sqlpp
|
||||
template<typename Policies>
|
||||
struct _member_t
|
||||
{
|
||||
using _data_t = dynamic_offset_data_t<Database>;
|
||||
|
||||
_impl_t<Policies> offset;
|
||||
_impl_t<Policies>& operator()() { return offset; }
|
||||
const _impl_t<Policies>& operator()() const { return offset; }
|
||||
|
2
include/sqlpp11/vendor/order_by.h
vendored
2
include/sqlpp11/vendor/order_by.h
vendored
@ -73,7 +73,7 @@ namespace sqlpp
|
||||
static_assert(::sqlpp::detail::all_t<is_expression_t<Expressions>::value...>::value, "at least one argument is not an expression in order_by()");
|
||||
|
||||
// Data
|
||||
using _data_t = select_flag_list_data_t<Database, Expressions...>;
|
||||
using _data_t = order_by_data_t<Database, Expressions...>;
|
||||
|
||||
// Member implementation with data and methods
|
||||
template<typename Policies>
|
||||
|
2
include/sqlpp11/vendor/select_flag_list.h
vendored
2
include/sqlpp11/vendor/select_flag_list.h
vendored
@ -98,7 +98,7 @@ namespace sqlpp
|
||||
template<typename Flag>
|
||||
void _add_impl(Flag flag, const std::true_type&)
|
||||
{
|
||||
return static_cast<typename Policies::_statement_t*>(this)->_select_flag_list()._dynamic_flags.emplace_back(flag);
|
||||
return _data._dynamic_flags.emplace_back(flag);
|
||||
}
|
||||
|
||||
template<typename Flag>
|
||||
|
4
include/sqlpp11/vendor/where.h
vendored
4
include/sqlpp11/vendor/where.h
vendored
@ -77,8 +77,6 @@ namespace sqlpp
|
||||
template <typename Policies>
|
||||
struct _impl_t
|
||||
{
|
||||
using _data_t = where_data_t<Database, Expressions...>;
|
||||
|
||||
template<typename Expression>
|
||||
void add_ntc(Expression expression)
|
||||
{
|
||||
@ -115,6 +113,8 @@ namespace sqlpp
|
||||
template<typename Policies>
|
||||
struct _member_t
|
||||
{
|
||||
using _data_t = where_data_t<Database, Expressions...>;
|
||||
|
||||
_impl_t<Policies> where;
|
||||
_impl_t<Policies>& operator()() { return where; }
|
||||
const _impl_t<Policies>& operator()() const { return where; }
|
||||
|
@ -55,7 +55,6 @@ int main()
|
||||
int64_t a = row.alpha;
|
||||
const std::string b = row.beta;
|
||||
}
|
||||
#if 0
|
||||
|
||||
for (const auto& row : db(select(all_of(t).as(t)).from(t).where(true)))
|
||||
{
|
||||
@ -70,7 +69,8 @@ int main()
|
||||
const bool g = row.gamma;
|
||||
}
|
||||
|
||||
auto s = dynamic_select(db).dynamic_columns(all_of(t)).dynamic_flags().dynamic_from(t).extra_tables(f,t).dynamic_where()/*.dynamic_group_by(t.alpha).dynamic_order_by().dynamic_having(t.gamma).dynamic_limit().dynamic_offset()*/;
|
||||
auto stat = sqlpp::select().columns(all_of(t)).flags(sqlpp::all).from(t).extra_tables(f,t).where(t.alpha > 0).group_by(t.alpha).order_by(t.gamma.asc()).having(t.gamma).limit(7).offset(19);
|
||||
auto s = dynamic_select(db).dynamic_columns(all_of(t)).dynamic_flags().dynamic_from(t).extra_tables(f,t).dynamic_where().dynamic_group_by(t.alpha).dynamic_order_by().dynamic_having(t.gamma).dynamic_limit().dynamic_offset();
|
||||
s.select_flags.add(sqlpp::distinct);
|
||||
s.selected_columns.add(f.omega);
|
||||
s.from.add(f);
|
||||
@ -85,9 +85,7 @@ int main()
|
||||
int64_t a = row.alpha;
|
||||
}
|
||||
|
||||
|
||||
auto X = select(all_of(t)).from(t).as(t.alpha);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user