taozhi8833998 / taozhi8833998/node-sql-parser
Scalar subqueries don't work with trino
Open
@taozhi8833998 is already working on this.
Since Feb 5, 2026.
- Dominant language
- PEG.js
- Stars
- 1k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Throws invalid column clause with select statement when using scalar subqueries.
Database Engine
Trino
To Reproduce
SELECT
order_id,
(SELECT max(discount) FROM discounts d WHERE d.order_id = o.order_id) AS max_discount
FROM orders o
node-sql-parser version: ^5.3.10
js environment: chromium 144
Expected behavior
Should not throw, might want to return a select statement or something
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.