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

transformer from is not called. #153

Open
nxzz opened this issue Oct 3, 2022 · 2 comments
Open

transformer from is not called. #153

nxzz opened this issue Oct 3, 2022 · 2 comments

Comments

@nxzz
Copy link

nxzz commented Oct 3, 2022

Package versions and database engine type (please complete the following information):

  • Database Engine: mysql
  • TypeORM Version: 0.3.9
  • Driver Version 2.4.4

Describe the bug
@Column transformer from is not called.

To Reproduce
https://github.com/nxzz/typeorm-aurora-data-api-driver-transform-issue/tree/4f2f67e65cc7e9fd3e7866952303239151b7e154
When I run the code in this repository, transformer from is not displayed as shown below.

$ secretArn="xxxxxx" resourceArn="xxxxxxx" npx ts-node main.ts
transformer to
TestData { id: 1, data: 'testdata' }
[ TestData { id: 1, data: 'testdata' } ]
TestData { id: 1, data: 'testdata' }

If the DataSource is mysql, you will see transformer from as shown below.

$ npx ts-node mysql.ts
transformer to
TestData { id: 1, data: 'testdata' }
transformer from
[ TestData { id: 1, data: 'TESTDATA' } ]
transformer from
TestData { id: 1, data: 'TESTDATA' }

Thankyou.

@CorentinDoue
Copy link

I reproduced this too. If it can help, we constated that the from transformer is called when the value is null. It's not very useful.

@nxzz
Copy link
Author

nxzz commented Oct 17, 2022

I can't create a PR because I don't have time to write test code, but I got it to work with this patch.
master...nxzz:typeorm-aurora-data-api-driver:master#diff-16226b3f7ac28247a0d19adda562aa4fa0fe3aa25dcd1edef430e84d286226eb

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

No branches or pull requests

2 participants