Skip to content

Use optional pool parameters in connection object #445

Closed
@markselby

Description

@markselby

Using grunt to read a config/database.yml, I've added connection pool options.

var conn = grunt.file.readYAML('config/database.yml')[process.env.NODE_ENV];

defaults: &defaults
host: localhost
username: mark
password: whatever
idle: 30000
reap: 1000

development:
<<: *defaults
database: whatever_development
min: 10
max: 50

production:
host: production.host

database: whatever_production

In lib/pool.js the changes are just ......

pool = genericPool.Pool({
name: name,
min: clientConfig.min || defaults.poolSize,
max: clientConfig.max || defaults.poolSize,
idleTimeoutMillis: clientConfig.idle || defaults.poolIdleTimeout,

reapIntervalMillis: clientConfig.reap || defaults.reapIntervalMillis,

Fancy adding that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions