Skip to content
Snippets Groups Projects
Commit b139fc7a authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

sqlite: Query: Don't hide the query type when returning it

We can still convert it back to a Query<> when returning it to the
application, but we'll temporary have access to the entire class, which
allows use to customize the query before returning it
parent 0e0260d5
No related branches found
No related tags found
No related merge requests found
......@@ -165,26 +165,24 @@ private:
};
template <typename Impl, typename Intf = Impl, typename... Args>
Query<Intf> make_query( MediaLibraryPtr ml, std::string field, std::string base,
std::string orderAndGroupBy, Args&&... args )
std::unique_ptr<SqliteQuery<Impl, Intf, Args...>>
make_query( MediaLibraryPtr ml, std::string field, std::string base,
std::string orderAndGroupBy, Args&&... args )
{
return std::unique_ptr<IQuery<Intf>>(
new SqliteQuery<Impl, Intf, Args...>( ml, std::move( field ),
return std::make_unique<SqliteQuery<Impl, Intf, Args...>>( ml, std::move( field ),
std::move( base ),
std::move( orderAndGroupBy ),
std::forward<Args>( args )... )
);
std::forward<Args>( args )... );
}
template <typename Impl, typename Intf = Impl, typename... Args>
Query<Intf> make_query_with_count( MediaLibraryPtr ml, std::string countReq,
std::string req, Args&&... args )
std::unique_ptr<SqliteQueryWithCount<Impl, Intf, Args...>>
make_query_with_count( MediaLibraryPtr ml, std::string countReq, std::string req,
Args&&... args )
{
return std::unique_ptr<IQuery<Intf>>(
new SqliteQueryWithCount<Impl, Intf, Args...>(
return std::make_unique<SqliteQueryWithCount<Impl, Intf, Args...>>(
ml, std::move( countReq ), std::move( req ),
std::forward<Args>( args )... )
);
std::forward<Args>( args )... );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment