-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested and related data? #55
Comments
Do you mean one-to-many (which hopefully can be modeled via the relationships or queries module) or many-to-many? |
I do indeed mean 1->many, so it sounds like I've missed an example or I'm misunderstanding something. Specifically I'm asking about how to use https://tinybase.org/api/queries/type-aliases/definition/join/ to achieve one->many queries. I tried following the Movie Database demo as the closest example, but of course here the relationship is a many->many. My workaround currently is to store the rowId of the source table row in the matching row of the target table and then execute two queries and join the data together manually. Not sure if this is the intended solution but it feels sub-optimal.
|
Ok so I see the challenge here: you are using a cell called 'Id' rather than the native rowId (which is used in join conditions). It's not possible to create a join based on columns in both tables. Instead you need to create an expression based on columns in one table (the 'root' table) that identifies the rowId to join to. Is it possible for you to use id also as the rowId? |
...Not to say your requirement isn't a valid one - just seeing if that helps you out for now. |
Sorry to open this as an issue but I noticed you've previously said you don't get notifications for Discussions.
Has there been any further movement on supporting one->many queries? Or a pattern I should be following?
_Originally posted in #18
The text was updated successfully, but these errors were encountered: