xataio / xataio/learn-postgres
Shell: trailing comments after semicolon never submit
Open
@dascalescuro is already working on this.
Since Aug 27, 2026.
bug
ready-for-agent
- Dominant language
- MDX
- Stars
- 7
- Forks
- 1
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 36
Description
Symptom
In the browser shell, a statement that ends with ; followed by a -- or /* */ comment stays on the continuation prompt (learn->) instead of running.
Examples that fail to submit:
SELECT 1; -- doneSELECT 1;/* done */SELECT 1;\n-- done
Expected
isStatementComplete (and the shell docstring) treat the last non-comment, non-whitespace character as decisive — so these should submit like psql.
Red loop (already run)
import { isStatementComplete } from './components/shell/sql-complete.ts';
isStatementComplete('SELECT 1; -- x'); // got false, expect true
Where
components/shell/sql-complete.ts— final check is/;\s*$/, which does not skip trailing comments- Called from
components/shell/readline.tson Enter
Notes
Diagnosed with /diagnosing-bugs. Minimized repro is the three inputs above; plain SELECT 1; still works.
Contributor guide
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.