vlcn-io / typed-sql

MIT License
101 stars 2 forks source link

traverse the AST to the point where relation information is available #3

Closed tantaman closed 1 year ago

tantaman commented 1 year ago

The basic idea is to:

  1. Pull the selection set. I.e., everything left of FROM: SELECT [...] FROM
  2. Descend into everything to the right of FROM
  3. Convert that information to relations. I.e., (Option<name>, Vec<Column>) tuples.
  4. Resolve the types of the selection set from (1) against what was returned from (3) and return that as a relation.

This is a recursive process given sub-selects can exist.