DerekStride / tree-sitter-sql

SQL grammar for tree-sitter
http://derek.stride.host/tree-sitter-sql/
MIT License
155 stars 52 forks source link

feat: add recursive cte #190

Closed matthias-Q closed 1 year ago

matthias-Q commented 1 year ago

This add recursive CTEs.

I was thinking about an alternative implementation. Instead of

    cte: $ => seq(
      $.identifier,
      optional(paren_list(field("argument", $.identifier))),
      $.keyword_as,
...

we could use

    cte: $ => seq(
      choice(
        $.identifier,
        $.invocation
      ),
      $.keyword_as,
...

But invocation would be more permissive and is technically wrong.