Skip to content

fix: allow VALUES clause in CTEs in SQLite#2631

Open
sgress454 wants to merge 1 commit into
taozhi8833998:masterfrom
sgress454:sgress454/fix-cte-union-and-values
Open

fix: allow VALUES clause in CTEs in SQLite#2631
sgress454 wants to merge 1 commit into
taozhi8833998:masterfrom
sgress454:sgress454/fix-cte-union-and-values

Conversation

@sgress454
Copy link
Copy Markdown
Contributor

@sgress454 sgress454 commented Jan 26, 2026

This PR adds support for VALUES inside of common table expressions (CTEs) in SQLite. A unit test is added that includes both VALUES and for UNION clauses inside a CTE, since the fix involves updating the union_stmt rule.

Note that the union_stmt rule seems to be more referring to compound statements in general (which include UNION, UNION ALL, INTERSECT and EXCEPT) rather than just UNION, but renaming that is much higher touch so I just updated it in place.

Comment thread pegjs/sqlite.pegjs
return s ? `union ${s.toLowerCase()}` : 'union'
}

select_core
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select-core docs: https://sqlite.org/syntax/select-core.html

(it's basically either SELECT or VALUES)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant