Skip to content
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

Unify "joins" and "get predicates" using existential subqueries #235

Closed
gcampax opened this issue Aug 4, 2020 · 1 comment
Closed

Unify "joins" and "get predicates" using existential subqueries #235

gcampax opened this issue Aug 4, 2020 · 1 comment
Labels
cleanup Clean ups, refactorings, and code improvements that don't fall under other categories

Comments

@gcampax
Copy link
Contributor

gcampax commented Aug 4, 2020

The current distinction of join vs get predicate is somewhat arbitrary as it depends on the direction that the connection between the table goes. The syntax is inconsistent, and get predicates are limited to only filters.
Let's clean that up, and let's use subquery syntax as that more closely matches the semantics of being a kind of filter that also looks at a different table. Also subqueries are clearly not commutative, unlike joins.

Strawman syntax:

@org.schema.Restaurant.Restaurant() filter exists (@org.schema.Restaurant.Review() filter author == "bob" && in_array(id, review))

and

@org.schema.Restaurant.Restaurant() filter id in ([restaurant] of (@org.schema.Review() filter author=="bob"))

(depending on the direction of the relation, restaurant -> review or review -> restaurant)

@gcampax gcampax added the cleanup Clean ups, refactorings, and code improvements that don't fall under other categories label Aug 4, 2020
@gcampax gcampax added this to the ThingTalk 2.0 milestone Aug 4, 2020
@gcampax
Copy link
Contributor Author

gcampax commented Mar 3, 2021

Done in #310 , with some leftovers in #316 and #317

@gcampax gcampax closed this as completed Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Clean ups, refactorings, and code improvements that don't fall under other categories
Projects
None yet
Development

No branches or pull requests

1 participant