Skip to content

Support parameters in LIMIT and OFFSET - #2517

Merged
mathiasrw merged 1 commit into
AlaSQL:developfrom
pratyushsinghal7:issue-1381
Aug 19, 2026
Merged

mathiasrw merged 1 commit into
AlaSQL:developfrom
pratyushsinghal7:issue-1381

Conversation

@pratyushsinghal7

Copy link
Copy Markdown
Contributor

Fixes #1381

Summary

  • allow ParamValue in the LimitClause and OffsetClause grammar productions, so LIMIT ?, OFFSET ?, and named/dollar parameters parse instead of throwing "Expecting 'NUMBER', got 'QUESTION'"
  • resolve the bound limit/offset values from the params at statement execution time, so compiled statements can be reused with different values
  • regenerate src/alasqlparser.js with yarn jison (no new grammar conflicts)
  • add regression coverage for the reported query

Testing

  • bun test --preload ./test/bun-setup.js ./test/test1381.js (6 passed)
  • bun run test-only (2194 passed, 213 skipped, 0 failed)
  • bun x prettier --check src/40select.js test/test1381.js

@mathiasrw

Copy link
Copy Markdown
Member

Love it. Thank you!

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.

Using ? with limit causes "Expecting 'NUMBER', got 'QUESTION'" error

2 participants