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

@ducky-hong ducky-hong commented Jun 8, 2018

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.

@@ -200,9 +200,9 @@ class Sequelize {
}

This comment has been minimized.

@sushantdhiman

sushantdhiman Jun 8, 2018
Contributor

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

This comment has been minimized.

@ducky-hong

ducky-hong Jun 8, 2018
Author Contributor

I removed the empty check of the password.

@codecov
Copy link

@codecov codecov bot commented Jun 8, 2018

Codecov Report

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

… constructor options
@ducky-hong ducky-hong force-pushed the ducky-hong:fix-constructor-options branch from ae96e31 to 60302fe Jun 8, 2018
@sushantdhiman sushantdhiman requested a review from sequelize/orm Jun 12, 2018
@sushantdhiman sushantdhiman merged commit dd0c4c3 into sequelize:master Jun 12, 2018
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants