matt-42 / silicon

A high performance, middleware oriented C++14 http web framework please use matt-42/lithium instead
http://siliconframework.org
MIT License
1.73k stars 138 forks source link

Question about many-to-many relationships in ORM #35

Closed c-cesar closed 7 years ago

c-cesar commented 7 years ago

Hi. The blog API example is pretty impressive, but it only shows one-to-many relationships. There is support for many to many relationships? Even a manual mode declaring a type for the relationship table? I wold like to use Silicon as a RESTfull server to a frontend written in Riot.js as a pet project, but would need many to many relationships.

matt-42 commented 7 years ago

The ORM does not handle many to many relationships yet byt you can write the SQL request by hand :

c("SELECT name, age from users where group_id = ?")(my_group.id) |
[] (std::string& name, int& age) {
  std::cout << name << " " << age << std::endl;
};

Does it solve you problem ?