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(query builder): Throw error on missing or unknown properties #3324

Merged
merged 1 commit into from
Jan 7, 2019
Merged

fix(query builder): Throw error on missing or unknown properties #3324

merged 1 commit into from
Jan 7, 2019

Conversation

vlapo
Copy link
Contributor

@vlapo vlapo commented Dec 25, 2018

constructor() {
super();
Object.setPrototypeOf(this, UpdateValuesMissingError.prototype);
this.message = `Cannot perform update query because update values are not defined. Call "qb.set(...)" method to specify inserted values.`;
Copy link
Member

Choose a reason for hiding this comment

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

"updated values"

constructor(propertyPath: string) {
super();
Object.setPrototypeOf(this, ColumnMetadataNotFoundError.prototype);
this.message = `No column metadata for property "${propertyPath}" was found.`;
Copy link
Member

Choose a reason for hiding this comment

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

probably we need to give more user-friendly error. Users don't know what "metadata" means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. We need more user friendly errors. What do you suggest?
EntityColumnNotFound -> No entity column "${propertyPath}" was found.?

Copy link
Member

Choose a reason for hiding this comment

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

Yes it can be it

@vlapo
Copy link
Contributor Author

vlapo commented Jan 4, 2019

Totally forgot. Updated by comments.

@pleerock pleerock merged commit 5a651c0 into typeorm:master Jan 7, 2019
@pleerock
Copy link
Member

pleerock commented Jan 7, 2019

Thank you. This is important to mention in changelog. In can break some exist code in a way.

@vlapo vlapo deleted the update-qb-handle-unknown-props branch January 20, 2019 22:47
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.

Query builder update generates broken SQL
2 participants