Repository navigation
fix: count returned rows in history for statements with a result set - #22
Merged
Merged
Conversation
History and the session log summed `affectedRows ?? rowCount`. Drivers report `affectedRows: 0` for a SELECT — MySQL always did, and since Bun 1.4 Bun.SQL does the same for PostgreSQL and SQLite — so a read was logged as touching 0 rows. CI picked up Bun 1.4.4 and the history test started failing on main. `statementRowCount` counts what a statement returned when it produced a result set, and what it changed otherwise. The backend history, session log, demo adapter and the frontend history entry all use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
Review round 1 —
|
Also say what the columns check actually means and list query-result.ts in the shared module map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
Response to review round 1
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI on
mainbroke whenoven-sh/setup-bunstarted installing Bun 1.4.4.rpc-handlers > query.execute automatically logs to historynow fails, because aSELECT 1is logged withrowCount: 0.Cause
History and the session log record
affectedRows ?? rowCount. Bun.SQL reportsaffectedRowsfor every statement, including0for a SELECT:null0null000So a read was always logged as 0 rows on MySQL, and since Bun 1.4 on PostgreSQL and SQLite too.
Fix
statementRowCount()in@dotaz/shared/query-resultcounts what a statement returned when it produced a result set, and what it changed otherwise. This is the same split the result panel already makes oncolumns.length. It replaces the expression in all four places that summed it:Verified
tscare clean.Status
751c9a9, independent Claude subagent):approve. Nits addressed in9f9dc75; one older demo-driver bug is left as a follow-up.9f9dc75(check+integration).7654870). feat: agent CLI — database access for AI agents, with approval-gated writes #19 is rebased onto it.🤖 Generated with Claude Code