taozhi8833998 / taozhi8833998/node-sql-parser

Scalar subqueries don't work with trino

Open
#2,642 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.