Is it possible to manage table relationships with SOCI c++ database access library
Question
Let say I have two tables with a many-to-many relationship (i.e. there is a 3rd table only used for the relationship).
Does SOCI support the different types of 'join' in the statements?
If yes, does it work with all the databases (so called backends in the documentation) ?
Thanks!
Solution
With SOCI, you still have to construct your SQL statements and you can put join
s in them (or anything else for that matter). SOCI basically just helps you
- to get your input data into the SQL query (with
use(...)
) and - to work with the returned results in a nice way (with
into(...)
androwset
, etc.).
Since the result of a select
is just a list of rows, no matter whether you use join
or not, there's nothing stopping you from using them.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow