-
-
Notifications
You must be signed in to change notification settings - Fork 635
add automatic connection release with Symbol.asyncDispose after execu… #3590
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3590 +/- ##
==========================================
- Coverage 89.08% 89.06% -0.03%
==========================================
Files 86 86
Lines 13538 13544 +6
Branches 1569 1569
==========================================
+ Hits 12061 12063 +2
- Misses 1477 1481 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What could I do? I didn't understand why the errors were occurring, where could I put this change to release a connection after a query? |
Hi, @luiz-rissardi! Firstly, thank you for your contribution 🙋🏻♂️ Regarding the error returned, it's due to the lint check (Prettier). You can fix it running the command About the changes, the import mysql from 'mysql2/promise';
const pool = mysql.createPool('mysql://root:password@localhost:3306/test');
const connection = await pool.getConnection();
// ... some queries
connection.release(); You can check out the detailed documentation and examples at docs/examples/connections/create-pool and docs/examples/connections/createPoolCluster. I'm attempting to visualize the scenarios. Is this feature related to the new In this case, I believe it makes more sense to adopt this approach to close connections. What do you think? |
Primeiramente, obrigado a me ajudar na comunidade open source, essa é minha primeira vez tentando agir diretamente em uma biblioteca, a minha sugestão para as próximas versões seria implementar a liberação das conexões de createPool e createConnection automaticamente, sem a necessidade do .end() ou o .release(). |
You're welcome, @luiz-rissardi! I can also talk in Portuguese, but I'll continue talking in English here. Feel free to contact me directly if you prefer in Portuguese only. As I haven't tested the possible conflicts, I'd like to understand if |
@wellwelwel teria que ver se ele realmente está afetando os testes, eu não encontrei o motivo de tantos testes quebrarem |
Alguém conseguiu ver o porque dos testes terem dado errado? não tive muito tempo pra ver essa feature no projeto, de implementar o uso das novas "using" do javascript |
@luiz-rissardi, you can check the solution for the failed workflow in #3590 (comment) and about implementation (also for tests implementation based in Node.js version) in #3590 (comment). Feel free to ask if you have any questions 🙋🏻♂️ |
🇺🇸 Hey @luiz-rissardi, if you can't follow the conversation in English, feel free to call me on LinkedIn and chat in Portuguese 🤝 🇧🇷 Fala @luiz-rissardi, se você não puder seguir a conversa em inglês, fique à vontade para me chamar no LinkedIn e conversar em português 🤝 |
ADD: automatic connection release with Symbol.asyncDispose after execution