Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Aug 11, 2025

sql.Row.Append() will always make a deep copy of the row, so we should avoid it.
Instead we have copies to cached sql.Rows or reuse the backing array through append() (sometimes golang's runtime will allocate a new one anyway).

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Should we go further and completely remove the Row.Append() method and the remaining three references?

@jycor
Copy link
Contributor Author

jycor commented Aug 12, 2025

In the remaining uses, we actually want a deep copy of the sql.Row

@jycor jycor merged commit f6c0a7b into main Aug 12, 2025
8 checks passed
@jycor jycor deleted the james/append branch August 12, 2025 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants