You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] latest
[ ] @next
[x] 0.2.7 (or put your version here)
Steps to reproduce or a small repository showing the problem:
If i pass an empty string to the findOne method, it will ignore the param and doesn't use a where clause in the query.
example:
repo.findOne("foo") returns SELECT ... FROM ... WHERE id = ? -- PARAMETERS: ["foo"]
repo.findOne("") returns SELECT ... FROM ... (here without WHERE and PARAMETERS)
Is it intended? Probably it's not very usefull to set an empty string as a primary key for one of the entities, but in some cases, this behaviour will produce heavy problems (eg. passing an empty string by mistake to the server, typeorm will return the first entity of the table).
The text was updated successfully, but these errors were encountered:
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[x]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[ ]
latest
[ ]
@next
[x]
0.2.7
(or put your version here)Steps to reproduce or a small repository showing the problem:
If i pass an empty string to the findOne method, it will ignore the param and doesn't use a where clause in the query.
example:
repo.findOne("foo")
returnsSELECT ... FROM ... WHERE id = ? -- PARAMETERS: ["foo"]
repo.findOne("")
returnsSELECT ... FROM ...
(here without WHERE and PARAMETERS)Is it intended? Probably it's not very usefull to set an empty string as a primary key for one of the entities, but in some cases, this behaviour will produce heavy problems (eg. passing an empty string by mistake to the server, typeorm will return the first entity of the table).
The text was updated successfully, but these errors were encountered: