Is it possible to manage table relationships with SOCI c++ database access library

643 views Asked by At

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!

1

There are 1 answers

2
Mika Fischer On BEST ANSWER

With SOCI, you still have to construct your SQL statements and you can put joins in them (or anything else for that matter). SOCI basically just helps you

  1. to get your input data into the SQL query (with use(...)) and
  2. to work with the returned results in a nice way (with into(...) and rowset, 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.