mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-02 03:00:38 -06:00
Added missing overload for prepared statement parameters
This commit is contained in:
@@ -65,12 +65,19 @@ namespace sqlpp
|
||||
}
|
||||
|
||||
template<typename NamedExpr>
|
||||
auto parameter(NamedExpr namedExpr)
|
||||
auto parameter(const NamedExpr&)
|
||||
-> parameter_t<typename NamedExpr::_value_type, NamedExpr>
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
template<typename ValueType, typename AliasProvider>
|
||||
auto parameter(const ValueType&, const AliasProvider&)
|
||||
-> parameter_t<ValueType, AliasProvider>
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -77,6 +77,7 @@ int main()
|
||||
interpret(select(sqlpp::distinct, t.alpha, t.beta).from(t).where(t.alpha == 3).group_by(t.gamma).having(t.beta.like("%kuchen")).order_by(t.beta.asc()), printer).flush();
|
||||
interpret(select(sqlpp::distinct, t.alpha, t.beta).from(t).where(t.alpha == 3).group_by(t.gamma).having(t.beta.like("%kuchen")).order_by(t.beta.asc()).limit(17).offset(3), printer).flush();
|
||||
|
||||
interpret(parameter(sqlpp::bigint(), t.alpha), printer).flush();
|
||||
interpret(parameter(t.alpha), printer).flush();
|
||||
interpret(t.alpha == parameter(t.alpha), printer).flush();
|
||||
interpret(t.alpha == parameter(t.alpha) and (t.beta + "gimmick").like(parameter(t.beta)), printer).flush();
|
||||
|
||||
Reference in New Issue
Block a user