sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Invalidate cache on Rows.NextResultSet call

Open kamilkoduo opened this issue 1 year ago • 4 comments

When reading multiple result sets from sqlx.Rows using StructScan, some information obtained usCCCing costly reflect operations is cached for performance optimisation. However, different result sets in a single sqlx.Rows object might have different structures, so cache should be invalidated and rebuild after each NextResultSet call. Now this method is not overwritten, so old cache interferes with new structures after first result set scan.

Relates #857

kamilkoduo avatar Apr 12 '23 14:04 kamilkoduo

Thanks for the fix! There is another PR open for this issue: https://github.com/jmoiron/sqlx/pull/747 which includes a unit test.

@jmoiron any chance to get this or the other fix merged?

cornelk avatar Jun 30 '23 19:06 cornelk

@jmoiron Yeah, that's a real problem, it would be cool if you could merge one of these solutions

batazor avatar Aug 28 '23 14:08 batazor

@jmoiron Are you open to additional maintainers? There are a handful of really useful PRs that look straightforward and I'd be happy to help get them merged. This is a fantastic project and given its widespread use, keeping future changes in the original repo would be ideal.

tazimmerman avatar Oct 11 '23 19:10 tazimmerman

Hello, @ardan-bkennedy, and I recently stepped in to help maintain this project. We are currently evaluating all the opened PRs. We'll take a look at this shortly and see if this, #747 or another, will be a good solution for this problem.

dlsniper avatar Feb 01 '24 13:02 dlsniper