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

fixes 4753 #4826

Merged
merged 1 commit into from
Oct 13, 2019
Merged

fixes 4753 #4826

merged 1 commit into from
Oct 13, 2019

Conversation

elthrasher
Copy link
Contributor

This should fix #4753 and also provide a better way to actually get the database name.


// validate all created entity metadatas to make sure user created entities are valid and correct
entityMetadataValidator.validateMany(this.entityMetadatas.filter(metadata => metadata.tableType !== "view"), this.driver);
}

// This database name property is nested for replication configs.
protected getDatabaseName(): string {
const options = this.options;
Copy link
Contributor

Choose a reason for hiding this comment

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

const {replication, database} = this.options;
// ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This causes an issue with the typeguard. I can't be sure this.options contains replication until after the guard. I was trying to avoid the use of any. I like destructuring, but don't think it's worth the cost here.

@pleerock
Copy link
Member

Thanks @elthrasher so much!

@pleerock pleerock merged commit df5479b into typeorm:master Oct 13, 2019
@elthrasher elthrasher deleted the issue-4753 branch October 13, 2019 18:08
@pleerock pleerock mentioned this pull request Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants