-
Notifications
You must be signed in to change notification settings - Fork 512
Open
Open
query and update into/using vector#1257
Description
HI,
I have exactly same problem as below
refer to stackoverflow:
https://stackoverflow.com/questions/42260993/c-soci-query-into-vector-of-custom-object
to select batch of size rows to vector of custom struct.
template<> struct type_conversion
{
typedef values base_type;
static void from_base(const values& v, indicator /* ind */, Event& event)
{
event.m_id = v.get("id");
event.m_title = v.get("Title");
event.m_description = v.get("Description");
event.m_date = v.get("Date");
}
static void to_base(const Event& event, values& v, indicator& ind)
{
v.set("id", event.m_id);
v.set("Title", event.m_title);
v.set("Description", event.m_description);
v.set("Date", event.m_date);
ind = i_ok;
}
};
std::vector
sql << "SELECT * FROM Event", into(events)
The compilation error below:
Just wonder if this is supported in the latest version or workaround is necessary for this?
BTW, batch update from vector as well.
Appreciate the clarity.
Metadata
Metadata
Assignees
Labels
No labels