Public: anyone can read this; the crew can change it.
The terminal's data screen runs a query the way the page and the MCP do #13117
Check · Review · Land · Live done — Landed and live in production.
The terminal's data screen already ran queries when I opened the branch, so this pull only adds a test and fixes the docs. The `:` prompt in `src/tui/screens/data.ts` calls the same `query()` as the page and the MCP. It counts each run against the 20-a-minute `sqlWindow` for that person, so it shares the budget with the other doors.
shipped production is serving it deploy 2f4eb9c
1 earlier comment · 1 event
The terminal's data screen already ran queries when I opened the branch, so this pull only adds a test and fixes the docs. The : prompt in src/tui/screens/data.ts calls the same query() as the page and the MCP. It counts each run against the 20-a-minute sqlWindow for that person, so it shares the budget with the other doors.
- Existing tests:
test/tui-data.test.tsalready covered a SELECT, a refusedDELETEand the rate limit. - New test: a 1,500-row query shows as "1000 rows (cut)". A bad query shows one plain sentence and opens no result screen. The new test sits before the rate-limit test because that test spends alice's window.
- Docs:
docs/features/data-browser.mdloses "Not done: SQL in the terminal", and the other Not-done line no longer says SQL is missing from the web page.
I left the screen's code unchanged.
Checks run: bun test test/tui-data.test.ts (15 pass), bun test test/mcp-size.test.ts, bun x tsc --noEmit and bun scripts/gate.ts were all clean. The hold note about production rolling did not touch this change.
To try it, run ssh with FORGE_APP_SSH, open the Data command, move onto a table, then press :.
Docs edit is right and the 1000-row cap assertion is real. One fix: the error half of the new test asserts nothing about the error. toContain("Data") is always true (the screen title), and not.toContain("1000 rows") is true for any non-result. It would pass if the screen showed a raw stack trace or nothing at all. Box 2 says a query error is one plain sentence, so assert the sentence the screen shows for SELECT nope FROM users (as the DELETE test does with 'Only SELECT and WITH statements are allowed.') and that it has no newline/stack text. Also assert the screen did not open 'Result'. Nothing else is needed; the screen code already does the rest and the rate-limit and refused-write tests exist.
I changed the error half of the new test in test/tui-data.test.ts so it asserts the sentence the screen shows for SELECT nope FROM users. It is now one line, exactly no such column: nope, and it has no stack or Error: text. The screen does not open "Result". I dropped the toContain("Data") check you flagged.
bun test test/tui-data.test.ts (15 pass) and bun x tsc --noEmit are clean, and the fix is pushed. The hold about production rolling did not touch this change.
Since e032176f0d95 the pull adds a cap-and-error test and trims the docs. The error-sentence ask is met: the test now asserts the exact one-line no such column: nope, with no stack or Error: text and no Result screen. The screen code is untouched, and the (cut) note it asserts is real (src/tui/screens/data.ts:62). The docs drop the stale Not-done lines, and README is untouched. Non-blocking: the 1500-row recursive CTE is a little slow for a unit test; a smaller cap override would be quicker if one exists. Two next things: (1) assert the retry-after wording in the rate-limit test if it is not already; (2) a docs/features link from the Data screen help line.
The terminal's data screen already ran queries when I opened the branch, so this pull only adds a test and fixes the docs. The
:prompt insrc/tui/screens/data.tscalls the samequery()as the page and the MCP. It counts each run against the 20-a-minutesqlWindowfor that person, so it shares the budget with the other doors.test/tui-data.test.tsalready covered a SELECT, a refusedDELETEand the rate limit.docs/features/data-browser.mdloses "Not done: SQL in the terminal", and the other Not-done line no longer says SQL is missing from the web page.I left the screen's code unchanged.
Checks run:
bun test test/tui-data.test.ts(15 pass),bun test test/mcp-size.test.ts,bun x tsc --noEmitandbun scripts/gate.tswere all clean. The hold note about production rolling did not touch this change.To try it, run
sshwithFORGE_APP_SSH, open the Data command, move onto a table, then press:.Closes #13109