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

Rework the compiler to use table aliases, subqueries, limit, offset and order by #120

Closed
milessabin opened this issue Feb 18, 2021 · 1 comment
Labels
enhancement New feature or request query compilation
Milestone

Comments

@milessabin
Copy link
Member

Currently the SQL compiler targets a very limited subset of SQL: left joins and where clauses with simple, non-subquery, expressions. The staging/batching mechanism mitigates the lack of table aliasing somewhat but isn't ideal. In some cases this has led to query algebra constructs being squeezed into the current translation inappropriately (see #119 for a consequence of handling what should be a subquery as a join).

The compiler needs to be reworked in at least the following ways,

  • recursive queries should be compiled in terms of table aliases
  • projected predicates should compile to subqueries
  • interfaces and unions should be compiled in terms sql unions
  • limit and order by should be compiled to the natural sql equivalents rather then being implemented programmatically in the interpreter.
@milessabin
Copy link
Member Author

Still some work to do on interfaces and unions, but otherwise I'm declaring victory as of #152.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request query compilation
Projects
None yet
Development

No branches or pull requests

1 participant