-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Usage of pool.getConnection() vs pool.query() #1668
Comments
yes, exactly what you explained yourself. |
two calls to |
Thanks for the timely response! What are your thoughts on adding that info to this section of the docs? (Unless I'm just missing it) |
I think it would be helpful for many |
OK great -- I'll create a pull request once I'm wrapped up with what I'm working on. |
The info here is very useful, I've created a PR which tries to incorporate it into README: #2031 |
I'm trying to understand the pros / cons of using
pool.getConnection()
overpool.query()
.From Issue #1202 I gathered that
pool.query
is essentially a shortcut forpool.getConnection()
,connection.query()
andconnection.release()
. So it would appear advantageous to just query the pool directly in most cases. The only major scenario where usingpool.getConnection()
might be beneficial is if you needed to execute a series of queries at once.The text was updated successfully, but these errors were encountered: