Skip to content

Conversation

@AldoFusterTurpin
Copy link

@AldoFusterTurpin AldoFusterTurpin commented Jan 14, 2026

Context
The fact that RegisterConnConfig "holds" an internal map that can grow without bound is something that could be stated explicitly.

PR changes
I believe it would be a good idea to explain an alternative for clients with many short-lived connections to many DBs, to avoid memory leaks. Being a bit more explicit and vocal in the comments about how that works will help clients to choose if they really want to use RegisterConnConfig or the alternative shared.

I placed the comment both in

  • RegisterConnConfig() (I believe this would be the perfect place as when you use a library you just check the docs from your editor and sometimes don't browse pkg.go.dev),
  • the top of the file in case people is browsing the documentation in https://pkg.go.dev/ so they can read through.

WDYT ?

Thank you!

Give an alternative for when we have clients with many short-lived
connections, to avoid memory leaks.
@AldoFusterTurpin
Copy link
Author

@jackc (Sorry for the ping) I believe this is pretty straightforward and can help new people using the module 🙂

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.

1 participant