We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I found that the following valid PostgreSQL query involving nested CTEs is not parsed correctly by this grammar:
WITH top_cte AS ( WITH nested_cte AS ( SELECT 1 as one, 2 as two ) SELECT one, two FROM nested_cte ) SELECT * FROM top_cte;
Received AST:
(program (ERROR (statement (keyword_with) (cte (identifier) (keyword_as) (ERROR (keyword_as)) (statement (select (keyword_select) (select_expression (term (literal) (keyword_as) (identifier)) (term (literal) (keyword_as) (identifier)))))) (select (keyword_select) (select_expression (term (field (identifier))) (term (field (identifier))))) (from (keyword_from) (relation (object_reference (identifier)))))) (statement (select (keyword_select) (select_expression (term (all_fields)))) (from (keyword_from) (relation (object_reference (identifier))))))
This SO answer says nested CTEs are not valid, at least for T-SQL. I found that PostgreSQL has no problem executing that query, though:
The text was updated successfully, but these errors were encountered:
@dmfay I was thinking that this should be fairly simple. I tested to add $._cte to the choices in
$._cte
tree-sitter-sql/grammar.js
Line 609 in ddd1763
Sorry, something went wrong.
Thank you both @matthias-Q and @dmfay for fixing it so fast!
Successfully merging a pull request may close this issue.
I found that the following valid PostgreSQL query involving nested CTEs is not parsed correctly by this grammar:
Received AST:
This SO answer says nested CTEs are not valid, at least for T-SQL. I found that PostgreSQL has no problem executing that query, though:
The text was updated successfully, but these errors were encountered: