Skip to content

Conversation

@ebebbington
Copy link
Member

@ebebbington ebebbington commented Jul 8, 2020

Fixes #145

Fixes #147

Adds documentation on the returned type for a query. This fixes issues for people who use deno lint (it throws a lot of errors when executing on result or client)

@ebebbington ebebbington changed the title [update-docs] Document query result interface [update-docs] Add further documentation Jul 8, 2020
docs/README.md Outdated
This improves performance, as creating a whole new connection for each query can be an expensive operation.
With pools, you can keep the connections open to be re-used when requested (`const client = dbPool.connect()`). So one of the active connections will be used instead of creating a new one.

The number of pools is up to you, but 50 is generally a good number, but this can differ based on how active your application is.
Copy link
Member

Choose a reason for hiding this comment

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

where did you see 50 as being a good number? I thought I had seen 20 be recommended (somewhere)... 😄

Overall this seems good change 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Can't remember now 😕 Like you, i saw it somewhere 😄 I'll change it to 20 though 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it here: 1d62518, note when i say "I think ...", i refer to yourself

Copy link
Member

@hayd hayd Jul 17, 2020

Choose a reason for hiding this comment

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

ha! I just looked at a few of my applications and see 200 - so maybe I was confused (though I've no idea how well deno handles that many open). I'd probably say "many" applications (or even "most") rather than "small".

Will merge anyway. One thing I like to use sometimes is to have multiple query pools - that way longer-running queries can be put into a separate pool (and not slow down queries which are important to be fast).

@hayd hayd merged commit 28249fb into denodrivers:master Jul 17, 2020
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.

Connection Management Best Practices DB Result Interface

2 participants