Join Queries - REST API

I have a fairly simple table structure with 2 tables.

The “parent” table has fields for US State and Topic. (State and Topic are each pull-down menus comprised of fixed values.)

The “child” table, Discussions, which can have multiple records for each parent record, has a date field.

I want to use the REST API to query for all Discussions with a date greater than X for a specific State, Topic or combination of the two. In addition, I want to return information from the Discussions table along with State and Topic from the parent table, sorted by date.

Is this possible with Tadabase? The only way I can think to do it is either:

  • Query for all parent records with matching a State and/or Topic (or both), loop through each of the results, then query for all Discussion records with a matching parent ID and with a date greater than X. Then I will need to sort the results post query.
  • Query for all Discussion records with a date greater than X in sort order, then loop through each and query for the corresponding parent record for each

Likely the former is more efficient and would require fewer queries, but does require post query sorting in my code. But this may result in dozens of queries for each search, much more complex code to support and eating into my limited API queries/day.

In a regular SQL DB this could be done with a single query using a simple join, with no postprocessing.