You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Review #2406 for code improvements: a view's subqueries are moved from the statement to its SELECT #2688
This is not a bug report. It is an invitation to look at #2406 again, because it works around the statement-level subquery list described in #2666. The goal is to understand the change and decide whether anything should be improved. The notes below come from a quick read of the diff and a few runs, not from a full analysis.
The concern:
The view's subqueries belong to the CREATE VIEW statement, not to its SELECT. The parser collects all subqueries of a statement into one list on the statement. For CREATE VIEW v AS SELECT (SELECT …) … that is the CREATE VIEW statement, so the view's SELECT could not find them. Fix error when creating view with subquery in alasql #2406 moves the list onto the SELECT in alasql.precompile (src/41exists.js, with an early return for views) and compiles the view lazily on first use.
If each SELECT owned its subqueries from parsing on (Give each SELECT its own list of subqueries from parsing on #2666), the view's SELECT would carry them itself, and the special case for views in precompile could go. Views with a scalar subquery, EXISTS and IN all work today.
Activity
mathiasrw commentedon Nov 26, 2026
Will be covered by #2666.