-
Couldn't load subscription status.
- Fork 0
Foreign Query
One of the unique features of the manager is the ability to create and run a "foreign" query.
The foreign query is the query where you run a query for another table based on the values of the current table.
Below is an explanation of how to use them.

All the examples below will be explained on top of the following 3 tables:
| Id | StartTimestamp | EndTimestamp | Sessions | Team1Id | Team2Id | ... |
|---|
-
Id- partition/hash key -
StartTimestamp- sort/range key
| Id | StartTimestamp | EndTimestamp | TeamId | ... |
|---|
-
Id- partition/hash key -
StartTimestamp- sort/range key
| TeamId | Timestamp | ... |
|---|
-
TeamId- partition/hash key -
Timestamp- sort/range key
In the Games table, Sessions attribute is the list of session ids that belong to that corresponding game.
Assume you are on the Sessions table data and would like to see shots for that team, the foreign query would look like:
Shots.TeamId = Sessions.TeamId

Sometimes you can only configure part of the query and the rest you would need to provide when running the query.
In this case, you can set not the exact value from the foreign table but put the ? instead. When running the query the popup will be displayed to let you know to fill the values for these ? placeholders. And so the foreign query would now look like:
Shots.TeamId = ?

If you use the attribute which represents the collection like type, i.e. set or list then one query will be run for each of the value from the corresponding collection. Like in the following case:
Sessions.Id = Games.Sessions
will result in multiple queries where Sessions.Id will be equal to each of the values from the Games.Sessions collection.
