I am working on NodeJs project which involves connection with PostgreSQL database. I came across two packages, namely, pg and pg-pool. Creator of these two packages is same, so there must be some differences in the functionalities of these two packages. Any idea, what are those? Which of the packages should be preferred?
Asked
Active
Viewed 1,172 times
1
-
1... pg uses pg-pool for pooling. pg wraps up boilerplate you'd need using just pg-pool. – Dave Newton Sep 14 '17 at 12:49
1 Answers
1
It is possible to write an app by using the Pool object only, but it still must be included via the main pg driver:
const Pool = require('pg').Pool;
pg-pool
only implements the pool itself + the querying interface. There is a lot more to the overall library - all resides in the pg module.
And you only include the pg within your package.json
.

vitaly-t
- 24,279
- 15
- 116
- 138