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
So, I was checking the code from PostgresDriver.js (/driver/postgres/PostgresDriver.js) and found out that there's no check if there's a transformer function set in the @Column decorator, and the code always checks first if the value if either null or undefined and returns it. As shown below:
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[x]
mssql
[x]
mysql
/mariadb
[x]
oracle
[x]
postgres
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[ ]
latest
[ ]
@next
[x]
0.2.11
(or put your version here)Steps to reproduce or a small repository showing the problem:
Have a NULL value in a column like user.name and try to transform it with the following code:
So, I was checking the code from PostgresDriver.js (
/driver/postgres/PostgresDriver.js
) and found out that there's no check if there's a transformer function set in the@Column
decorator, and the code always checks first if the value if either null or undefined and returns it. As shown below:The fix should be something as simple as checking if the transformer exists and if it does, execute it:
Some other people (##2777) and I believe the transformer should be executed nonetheless.
I'm willing to send a PR and add tests to fix such issue.
PS: MongoDriver got it right:
Thanks!
The text was updated successfully, but these errors were encountered: