Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: config.pool default min may greater than user's config max #1748

Conversation

chenhui5416
Copy link

use case:

  const knex = require('knex')({
    pool: {max: 1}
  })

Now, knex would thorw error, while pool max should greater than min.

@chenhui5416 chenhui5416 force-pushed the Fix-pool-config-max-less-default-min branch from d5fd102 to 6a19669 Compare October 19, 2016 02:52
@elhigu
Copy link
Member

elhigu commented Oct 19, 2016

Hi, thanks for the pull request. There is linting error and the test case for this is missing.

I think it would be better to just throw error if min > max in that way there wouldn't be any hidden functionality which will hide clearly invalid configuration.

Now if you pass { max: 2, min: 10 } to pool, automatic changing min -> 2 will hide this configuration fail, where you probably wanted to pass { min: 2, max: 10 } instead.

Copy link
Member

@elhigu elhigu left a comment

Choose a reason for hiding this comment

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

Just throwing an error because of invalid configuration is better than trying to automatically fix config. Also automatic test case is required.

@elhigu
Copy link
Member

elhigu commented Oct 31, 2017

Closing for now, can be reopened if implementation is fixed and test case added.

@elhigu elhigu closed this Oct 31, 2017
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.

None yet

2 participants