0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 04:47:18 +08:00

Added factory functions for several select sub clauses

This commit is contained in:
rbock 2016-04-15 09:37:34 +02:00
parent a3f29e18e7
commit 1e1b388a67
7 changed files with 85 additions and 3 deletions

View File

@ -271,6 +271,19 @@ namespace sqlpp
return context;
}
};
template <typename... T>
auto group_by(T&&... t) -> decltype(statement_t<void, no_group_by_t>().group_by(std::forward<T>(t)...))
{
return statement_t<void, no_group_by_t>().group_by(std::forward<T>(t)...);
}
template <typename Database, typename... T>
auto dynamic_group_by(const Database&, T&&... t)
-> decltype(statement_t<Database, no_group_by_t>().dynamic_group_by(std::forward<T>(t)...))
{
return statement_t<Database, no_group_by_t>().dynamic_group_by(std::forward<T>(t)...);
}
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2015, Roland Bock
* Copyright (c) 2013-2016, Roland Bock
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@ -312,6 +312,18 @@ namespace sqlpp
return context;
}
};
template <typename T>
auto limit(T&& t) -> decltype(statement_t<void, no_limit_t>().limit(std::forward<T>(t)))
{
return statement_t<void, no_limit_t>().limit(std::forward<T>(t));
}
template <typename Database>
auto dynamic_limit(const Database&) -> decltype(statement_t<Database, no_limit_t>().dynamic_limit())
{
return statement_t<Database, no_limit_t>().dynamic_limit();
}
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2015, Roland Bock
* Copyright (c) 2013-2016, Roland Bock
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@ -328,6 +328,18 @@ namespace sqlpp
return context;
}
};
template <typename T>
auto offset(T&& t) -> decltype(statement_t<void, no_offset_t>().offset(std::forward<T>(t)))
{
return statement_t<void, no_offset_t>().offset(std::forward<T>(t));
}
template <typename Database>
auto dynamic_offset(const Database&) -> decltype(statement_t<Database, no_offset_t>().dynamic_offset())
{
return statement_t<Database, no_offset_t>().dynamic_offset();
}
}
#endif

View File

@ -268,6 +268,19 @@ namespace sqlpp
return context;
}
};
template <typename... T>
auto order_by(T&&... t) -> decltype(statement_t<void, no_order_by_t>().order_by(std::forward<T>(t)...))
{
return statement_t<void, no_order_by_t>().order_by(std::forward<T>(t)...);
}
template <typename Database, typename... T>
auto dynamic_order_by(const Database&, T&&... t)
-> decltype(statement_t<Database, no_order_by_t>().dynamic_order_by(std::forward<T>(t)...))
{
return statement_t<Database, no_order_by_t>().dynamic_order_by(std::forward<T>(t)...);
}
}
#endif

View File

@ -446,6 +446,13 @@ namespace sqlpp
{
return statement_t<void, no_select_column_list_t>().columns(std::forward<T>(t)...);
}
template <typename Database, typename... T>
auto dynamic_select_columns(const Database&, T&&... t)
-> decltype(statement_t<void, no_select_column_list_t>().dynamic_columns(std::forward<T>(t)...))
{
return statement_t<Database, no_select_column_list_t>().dynamic_columns(std::forward<T>(t)...);
}
}
#endif

View File

@ -258,6 +258,19 @@ namespace sqlpp
return context;
}
};
template <typename T>
auto select_flags(T&& t) -> decltype(statement_t<void, no_select_flag_list_t>().flags(std::forward<T>(t)))
{
return statement_t<void, no_select_flag_list_t>().flags(std::forward<T>(t));
}
template <typename Database, typename T>
auto dynamic_select_flags(const Database&, T&& t)
-> decltype(statement_t<Database, no_select_flag_list_t>().dynamic_flags(std::forward<T>(t)))
{
return statement_t<Database, no_select_flag_list_t>().dynamic_flags(std::forward<T>(t));
}
}
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2015, Roland Bock
* Copyright (c) 2013-2016, Roland Bock
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@ -250,6 +250,18 @@ namespace sqlpp
}
};
};
template <typename T>
auto union_all(T&& t) -> decltype(statement_t<void, no_union_t>().union_all(std::forward<T>(t)))
{
return statement_t<void, no_union_t>().union_all(std::forward<T>(t));
}
template <typename T>
auto union_distinct(T&& t) -> decltype(statement_t<void, no_union_t>().union_distinct(std::forward<T>(t)))
{
return statement_t<void, no_union_t>().union_distinct(std::forward<T>(t));
}
}
#endif