Skip to content

fix: copy StringMap on insert and query in dbmem #11206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2023

Conversation

spikecurtis
Copy link
Contributor

Addresses the issue in #11185 for the StringMap datatype.

There are other slice data types in our database package that also need to be fixed, but that'll be a different PR

Copy link
Contributor Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

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

Thorough! 💪🏻

For the future, I wonder if it would make sense to add a marshal/unmarshal step to the return values of all methods. This should hopefully always work since a similar thing happens in the real DB layer. Adds overhead/makes this a bit slower, but should avoid the issue that prompted this change.

@Emyrk
Copy link
Member

Emyrk commented Dec 14, 2023

I hit this exact thing awhile back. I made an issue I never got around too: #6680

A marshal would solve it, just annoying to do on every function 😢

@mafredri
Copy link
Member

mafredri commented Dec 14, 2023

A marshal would solve it, just annoying to do on every function 😢

We should be able to code gen it. Named args and a defer at the top.

@Emyrk
Copy link
Member

Emyrk commented Dec 14, 2023

A marshal would solve it, just annoying to do on every function 😢

We should be able to code gen it. Named args and a defer at the top.

We need to document all our current code gen. Would be awesome if we had some standard framework for our code gens to all work under.

@spikecurtis spikecurtis merged commit fad4574 into main Dec 14, 2023
@spikecurtis spikecurtis deleted the spike/11185-dbmem-stringmap branch December 14, 2023 18:23
@github-actions github-actions bot locked and limited conversation to collaborators Dec 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants