Product
Socket Now Supports uv.lock Files
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
hapi-pg-pool
Advanced tools
Create a PostgreSQL connection pool available to Hapi request handlers.
Implements pooling with the pg-pool
package.
Install from NPM
npm i hapi-pg-pool -S
Ensure you have either your favourite PostgreSQL client dependency, or install the pg
client
npm i pg -S
Register the extension
server.register({
register: require('hapi-pg-pool'),
options: {
database: 'postgres',
user: 'postgres',
password: 'postgres'
}
}, function (err) {
if (err) {
throw err
}
// server.route(...)
})
Use the pool in your handlers
server.route({
method: 'GET',
path: '/',
handler: function(request, reply) {
console.log('sleepy...');
request.pg.query('SELECT pg_sleep(1)', function (err, result) {
if (err) {
server.log('error', err)
return reply(err)
}
reply('awake!')
})
}
});
Refer to pg-pool
for more ways to use the request.pg
(Pool) object.
MIT.
FAQs
Expose postgres connection pooling to request handlers.
The npm package hapi-pg-pool receives a total of 3 weekly downloads. As such, hapi-pg-pool popularity was classified as not popular.
We found that hapi-pg-pool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.