mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Adjust WITH clause to serialize RECURSIVE where required
This commit is contained in:
parent
f50500ba8b
commit
a5c8b40b07
@ -45,6 +45,8 @@ namespace sqlpp
|
||||
template<typename Database, typename... Expressions>
|
||||
struct with_data_t
|
||||
{
|
||||
using _is_recursive = logic::any_t<Expressions::_is_recursive...>;
|
||||
|
||||
with_data_t(Expressions... expressions):
|
||||
_expressions(expressions...)
|
||||
{}
|
||||
@ -74,7 +76,6 @@ namespace sqlpp
|
||||
using _tags = detail::type_set<>;
|
||||
};
|
||||
|
||||
|
||||
using _is_dynamic = is_database<Database>;
|
||||
|
||||
// Data
|
||||
@ -172,6 +173,8 @@ namespace sqlpp
|
||||
{
|
||||
// FIXME: If there is a recursive CTE, add a "RECURSIVE" here
|
||||
context << " WITH ";
|
||||
if (T::_is_recursive::value)
|
||||
context << "RECURSIVE ";
|
||||
interpret_tuple(t._expressions, ',', context);
|
||||
return context;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user