Dear Friends:
This is a contrived example so I can ask a question.
I have a Data Table, my_table, with these Columns:
- locations_row (a Linked column to single Rows in Data Table: locations)
- foo (a Text column)
- bar (a Text column)
We’re really focused on locations_row Column here, and not the other two.
Now, the locations Data Table, in turn, has these Columns (all contrived):
- Continent (Text)
- Country (Text)
- State (Text)
- City (Text)
- Town (Text)
So, to query my_table using a fully-qualified (non-duplicated) Row in the locations Data Table, I think I can do:
app_tables.my_table.search(locations_row = R # Where R is a fully-qualified Row in the locations Data Table.
But I also need to query my_table based on subsets of the Columns in the locations table, not necessarily just whole locations table Rows. (Although I do need that as well in other areas).
You see, I have the concept of scopes, where I need to query larger or smaller subsets of my_table based on varying columns in the locations Data Table
(which is linked to via my_table.locations_row Column).
I hope I got this example correct.
What is the syntax for this case?
Thank you!
EDIT: Maybe an example would be better:
app_tables.my_table.search(...)
How do I search based on, say, just, Continent
and Country
– or, say – State
and City
? (In other words, arbitrarily widen or narrow searches based on those columns).
PS: I normalized
my tables, so this is why this arises. So now I need to determine how the any-value for this or that column in a linked-to-destination-table is expressed.