Skip to content
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

How do you close connections???? #2751

Open
davidnewcomb opened this issue Jun 8, 2024 · 1 comment · May be fixed by #2725
Open

How do you close connections???? #2751

davidnewcomb opened this issue Jun 8, 2024 · 1 comment · May be fixed by #2725

Comments

@davidnewcomb
Copy link

On page node-mysql2/docs there isn't a single example of how to close the connection after you have used it!
Pooled connections get a brief mention.

On connections/create-connection no mention of closing connections again. However, on page connections/create-pool, each connection example has some code and then a warning to say, "don't forget to add some of the bits we missed out of our example". Seriously? And connections/createPoolCluster doubles down on examples and warnings.

I seem to remember seeing on one page something about .end() there was no explanation, it was just stuffed into one of the testing examples and never mentioned again. I can't even find the page now!

I was so confused by all this that I had to Google it. The first result in the rankings was a StackOverflow article from 7 years ago where people are literally having to guess what the answer is.

Please can you add the "obvious" bits to the documentation around closing connections. Including any gotchas about running in production or development modes for the various stragegies (for example) would be really helpful.

@wellwelwel wellwelwel linked a pull request Jun 8, 2024 that will close this issue
@wellwelwel
Copy link
Collaborator

Hi, @davidnewcomb 🙋🏻‍♂️

This PR intends to solve this:


For now, there are some examples closing the connection methods in Testing sections:

But I also agree that this should be better located in the documentation.


Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants