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

Allow all of Sequelize options in config.sequelize #5

Merged
merged 2 commits into from
Mar 14, 2017

Conversation

huacnlee
Copy link
Collaborator

@huacnlee huacnlee commented Mar 13, 2017

http://docs.sequelizejs.com/en/v3/api/sequelize/#new-sequelizedatabase-usernamenull-passwordnull-options

Issue from: eggjs/egg#341

for example:

exports.sequelize = {
  port: '3306',
  host: 'localhost',
  username: 'root',
  password: '',
  database: 'test',
  dialect: 'mysql',
  pool: {
    max: 5,
    min: 0,
    idle: 10000,
  },
  storage: 'db/test-foo.sqlite',
  timezone: '+08:01',
};
  • Do not assert config.host, password, port config, let them has default value.
  • Do not assert config.database, because SQLite case is not needs it.
Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

http://docs.sequelizejs.com/en/v3/api/sequelize/#new-sequelizedatabase-usernamenull-passwordnull-options

for example:

```js
exports.sequelize = {
  port: '3306',
  host: 'localhost',
  username: 'root',
  password: '',
  database: 'test',
  dialect: 'mysql',
  pool: {
    max: 5,
    min: 0,
    idle: 10000,
  },
  storage: 'db/test-foo.sqlite',
  timezone: '+08:01',
};
```

Do not assert config.host, password, port config, let them has default value.
Do not assert config.database, because SQLite case not need it.
@mention-bot
Copy link

@huacnlee, thanks for your PR! By analyzing the history of the files in this pull request, we identified @popomore, @jtyjty99999 and @luicfer to be potential reviewers.

@codecov
Copy link

codecov bot commented Mar 13, 2017

Codecov Report

Merging #5 into master will not change coverage.
The diff coverage is 100%.

@@          Coverage Diff          @@
##           master     #5   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines          39     35    -4     
=====================================
- Hits           39     35    -4
Impacted Files Coverage Δ
lib/loader.js 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f96a29...5f3271f. Read the comment docs.

lib/loader.js Outdated
@@ -16,30 +15,18 @@ Sequelize.prototype.log = function() {
module.exports = app => {
const config = Object.assign(app.config.sequelize, {
Copy link
Member

Choose a reason for hiding this comment

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

应该是调转来,app.config.sequelize 去 merge 默认的

@fengmk2 fengmk2 merged commit e414f9d into master Mar 14, 2017
@fengmk2 fengmk2 deleted the fix/support-more-sequelize-options branch March 14, 2017 02:26
@fengmk2
Copy link
Member

fengmk2 commented Mar 14, 2017

我发 patch

@fengmk2
Copy link
Member

fengmk2 commented Mar 14, 2017

@jtyjty99999 我发不了,只能你来发。

@fengmk2
Copy link
Member

fengmk2 commented Mar 14, 2017

npm owner 加一下我们吧

@huacnlee
Copy link
Collaborator Author

修改 Changelog

@atian25
Copy link
Member

atian25 commented Mar 14, 2017

@huacnlee changelog 在 release 的时候用命令生成的

$ git changelog -n -t 1.1.0
$ vim package.json  # change `version`
$ git release 1.1.0
$ npm publish

@jtyjty99999
Copy link
Member

adamsdeMacBook-Pro:egg-sequelize adams$ npm publish
+ egg-sequelize@2.0.1
adamsdeMacBook-Pro:egg-sequelize adams$ npm owner add fengmk2
+ fengmk2 (egg-sequelize)

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.

5 participants