mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Added into() free function
This commit is contained in:
parent
ba1f200ef1
commit
548a601026
@ -27,6 +27,7 @@
|
||||
#ifndef SQLPP_INTO_H
|
||||
#define SQLPP_INTO_H
|
||||
|
||||
#include <sqlpp11/statement_fwd.h>
|
||||
#include <sqlpp11/type_traits.h>
|
||||
#include <sqlpp11/no_value.h>
|
||||
#include <sqlpp11/no_data.h>
|
||||
@ -168,6 +169,11 @@ namespace sqlpp
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... T>
|
||||
auto into(T&&... t) -> decltype(statement_t<void, no_into_t>().into(std::forward<T>(t)...))
|
||||
{
|
||||
return statement_t<void, no_into_t>().into(std::forward<T>(t)...);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -37,7 +37,7 @@ int main()
|
||||
test::TabFoo f;
|
||||
test::TabBar t;
|
||||
|
||||
auto c = custom_query(select(all_of(t)).from(t), sqlpp::verbatim("INTO"), f);
|
||||
auto c = custom_query(select(all_of(t)).from(t), into(f));
|
||||
std::cerr << serialize(c, printer).str() << std::endl;
|
||||
db(c);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user