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

Where drops wrong entity properties silently #2528

Closed
spech66 opened this issue Jul 16, 2018 · 2 comments
Closed

Where drops wrong entity properties silently #2528

spech66 opened this issue Jul 16, 2018 · 2 comments

Comments

@spech66
Copy link

spech66 commented Jul 16, 2018

Issue type:

[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue

Database system/driver:

[ ] cordova
[ ] mongodb
[ ] mssql
[x] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo

TypeORM version:

[x] latest
[ ] @next
[ ] 0.x.x (or put your version here)

Steps to reproduce or a small repository showing the problem:

class User {
    Email!: string;
}
class export class UserRepository extends AbstractRepository<User> {
    public getByEmail(mail: string): Promise<User | undefined> {
        return this.repository.findOne({where: { Email: mail }});
    }
}

This works es expected.

query: SELECT ... FROM `user` `User` WHERE `User`.`email` = ? -- PARAMETERS: ["u1@test.test"]

However if I change the Email in the where clause to email or anything different the query is executed without the where clause.

        return this.repository.findOne({where: { email: mail }});
        return this.repository.findOne({where: { x: mail }});
query: SELECT ... FROM `user` `User`

Shouldn't this throw an exception of missing columns instead?

@spech66
Copy link
Author

spech66 commented Oct 31, 2018

Isn't this a major problem for queries?

@vlapo
Copy link
Contributor

vlapo commented Jan 15, 2019

Closing in favor of #3416

@vlapo vlapo closed this as completed Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants