Open VadVergasov opened 2 years ago
I'm not familiar with the boost integration of SOCI, but my guess is that you're either missing the soci/boost-tuple.h
include or SOCI doesn't provide a type_conversion
for boost::tuple
anymore, so you have to provide your own for that (see below).
I've included boost-tuple.h and it works with base types like string, int and etc. but not with ORM types.
Also I'm getting exception:
Only one Row element allowed in a single statement.
when trying to execute this code:
std::string query = "SELECT stock.*, laptop.*, provider.* FROM stock JOIN laptop ON laptop.id = stock.laptop JOIN provider ON provider.id = stock.source LIMIT 10";
soci::rowset<boost::tuple<stock, laptop, provider>> rs = (sql.prepare << query);
Also all types are defined and added all required conversions. Can't find any additional info about this exception
I'm trying to use tuple with my type and some other. Here is the example of the code:
And I'm getting such exception:
Cannot convert data while fetching data from "SELECT stock.*, laptop.name, provider.name FROM stock JOIN laptop ON laptop.id=stock.laptop JOIN provider ON provider.id=stock.source LIMIT 10".
In struct stock there are all required conversions (Here is the code). Is SOCI isn't supporting using tuples with ORM types, only based on base types?