Repository navigation
fix: Bind a nanoarrow stream in params with dbBindArrow() - #662
Merged
Merged
Conversation
`dbGetQueryArrow()` and `dbSendQueryArrow()` pass `params` unchanged to `dbSendQuery()`, which bound it with `dbBind()` and rejected every stream (#661). `dbSendQuery()` now binds a stream with `dbBindArrow()` and anything else with `dbBind()` as before. It also clears the new result if binding fails, so no open result set is left behind. The error for a stream passed to `dbBind()` now names `dbBind()` itself, and the error for named parameters is split into two sentences. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
An error while evaluating the lazy `params` argument left the result created by `dbSendQuery()` open, because it happened before the cleanup was registered. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
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.
Closes #661.
dbGetQueryArrow()anddbSendQueryArrow()passparamsunchanged todbSendQuery(), which bound it withdbBind()and so rejected every nanoarrow stream.dbSendQuery()now binds ananoarrow_array_streamwithdbBindArrow()on the new result, which converts it to a list and executes once per row, and binds anything else withdbBind()as before.dbSendQuery()also clears the new result when binding fails, so a failed call no longer leaves an open result set behind (and the next query no longer warns "Closing open result set"). This applies to the list path too, for example to named list parameters passed todbGetQuery().Since
dbSendQuery()no longer passes a stream todbBind(), the dedicated error from #658 now only fires for a directdbBind(res, stream)call; its wording now namesdbBind()and points todbBindArrow(). The "must not be named" message is split into two sentences, as asked in the review of #658.Tests cover
dbGetQueryArrow(params = stream)with one and several rows,dbSendQueryArrow(params = stream)followed bydbFetchArrow(), a failing bind leaving no open result for both a stream and a list, and unchanged list parameters. The fulldevtools::test()passes locally against PostgreSQL 16, including the DBItest arrow specs.This PR is stacked on #658. Native Arrow support (#631) would supersede the conversion through
dbBindArrow().Session: https://claude.ai/code/session_01Hr1rd5LPjEzyaTRpXAuS6g
Generated by Claude Code