![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Easily create a Postgres/MySQL connection pool (postgres only until I get MariaDB/MySQL working on my new Ubuntu 13.04 dev machine).
Behind the scenes it returns an any-db pool which can be used as described here.
Install the module with: npm install db-pool
Create a config/database.js containing something like
exports.app1 = {
defaults: {
driver: 'postgres',
min: 5,
max: 20
},
development: {
database: "development",
username: "username",
password: "pass"
},
production: {
database: "production",
username: "username",
password: "pass",
port: 9999
},
test: {
database: "test",
username: "username",
password: "pass",
host: "some.hostname",
min: 15
}
};
exports.app1 = {
...
...
}
var db_pool = require('db-pool');
// Optionally specify an alternative config file (default is to use /config/database.js)
db_pool.config('/config/custom-db-config-file.js');
// Create the default pool (from app1) using NODE_ENV=development|test|production
var test = db_pool.pool();
// Create a pool to a development database
var dev = db_pool.pool('development');
var app1_dev = db_pool.pool('app1.development');
// Create another pool to a different database
var test = db_pool.pool('test');
// Show the known connections. Active ones have pool, connStr and merged default attributes.
console.log(db_pool.debug());
// Run a query
dev.query("SELECT 1", function (err, results) {
console.log(results);
// Terminate all active pools
db_pool.closeAll();
})
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
v0.1.0 Postgres supported
Copyright (c) 2013 Mark Selby
Licensed under the MIT license.
FAQs
Easily create a Postgres/MySQL connection pool
We found that db-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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.