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(constructor): set the username, the password and the database via constructor options #9517

Merged
merged 1 commit into from Jun 12, 2018

Conversation

ducky-hong
Copy link
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

The document says that the username, the password and the database can be passed as options with URL. (e.g. new Sequelize('mysql://localhost:3306', { database, username, password }))
But the current behavior does not honour these fields in options. This PR allows to pass these fields as options.

lib/sequelize.js Outdated
@@ -200,9 +200,9 @@ class Sequelize {
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Line 198, which looks like a complex empty check can be removed now, just having this should work

password: config.password || this.options.password || null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the empty check of the password.

@codecov
Copy link

codecov bot commented Jun 8, 2018

Codecov Report

Merging #9517 into master will not change coverage.
The diff coverage is n/a.

@sushantdhiman sushantdhiman requested a review from a team June 12, 2018 05:39
@sushantdhiman sushantdhiman merged commit dd0c4c3 into sequelize:master Jun 12, 2018
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

4 participants