mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 21:04:15 +08:00
Add operator() to allow query with callback
This commit is contained in:
parent
628b0bbaff
commit
f3b9442c9f
@ -57,6 +57,18 @@ namespace sqlpp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pool_connection(const pool_connection&) = delete;
|
||||||
|
pool_connection(pool_connection&& other) : _impl(std::move(other._impl)), origin(other.origin)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
pool_connection& operator=(const pool_connection&) = delete;
|
||||||
|
pool_connection& operator=(pool_connection&& other)
|
||||||
|
{
|
||||||
|
_impl = std::move(other._impl);
|
||||||
|
origin = other.origin;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename... Args>
|
template<typename... Args>
|
||||||
auto operator()(Args&&... args) -> decltype(_impl->args(std::forward<Args>(args)...))
|
auto operator()(Args&&... args) -> decltype(_impl->args(std::forward<Args>(args)...))
|
||||||
{
|
{
|
||||||
@ -81,16 +93,10 @@ namespace sqlpp
|
|||||||
return _impl->prepare(t);
|
return _impl->prepare(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
pool_connection(const pool_connection&) = delete;
|
template<typename Query, typename Lambda>
|
||||||
pool_connection(pool_connection&& other) : _impl(std::move(other._impl)), origin(other.origin)
|
void operator()(Query query, Lambda callback)
|
||||||
{
|
{
|
||||||
}
|
query_task<Connection_pool, Query, Lambda>(*origin, query, callback)();
|
||||||
pool_connection& operator=(const pool_connection&) = delete;
|
|
||||||
pool_connection& operator=(pool_connection&& other)
|
|
||||||
{
|
|
||||||
_impl = std::move(other._impl);
|
|
||||||
origin = other.origin;
|
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user