sqlite_orm icon indicating copy to clipboard operation
sqlite_orm copied to clipboard

IN operator can support list?

Open tocky0 opened this issue 3 years ago • 1 comments

when use in operator in where conditions,as flow,

std::list<int> user_ids;
getStorage().get_all<User, std::list<User>>(where(in(&User::m_user_id, user_ids)));

the where conditions user_ids type is std::list, will build code fail, exception like,

SqliteTools.hpp:9535:29: error: ‘sqlite_orm::internal::statement_serializator<std::__cxx11::list<int>, void> serializator’ has incomplete type
   statement_serializator<T> serializator;

when replace with std::vector<int> user_ids, build ok.
so how to fix it?
thinks~

tocky0 avatar Aug 02 '22 10:08 tocky0

we need to add either support for std::list<T> or for generic STL container

fnc12 avatar Aug 02 '22 11:08 fnc12

@tocky0 I am working on it

fnc12 avatar Oct 07 '23 15:10 fnc12

@tocky0 PR is on its way https://github.com/fnc12/sqlite_orm/pull/1226

fnc12 avatar Oct 07 '23 19:10 fnc12

@tocky0 please check dev branch - now std::list is supported by in function

fnc12 avatar Oct 08 '23 08:10 fnc12