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
[Bug]: Formula set as ScalarReference not loaded as LoadedScalarReference at runtime #5557
Comments
Closing due to realizing that the |
Let's keep this open, I want to review it first (probably this evening). ts-morph should pick this up, and it might be failing because you use it with the |
Yes, I saw that before I closed the issue. Required a bit of refactoring for it to work. It has now been added. |
Yeah, this is surely something to fix, it's about the |
So the problem here is that the TS compiler API returns the type for edit: Damn, I again forget that the compiler API likes to give |
Wow, what a simple fix for such a weird issue haha |
Describe the bug
When using a formula with a lazy scalar reference, it appears as type
ScalarReference
orLoadedScalarReference
when using the.load()
,.get()
, or.$
methods. However, at runtime, all properties are lost and the field is loaded as the formula value. Additionally, in MySQL, if set to a Boolean type, it does not serialize and ends up as a TinyInt.Reproduction
https://github.com/kpervin/mikro-orm-reproduction/tree/lazy-scalar-reference-issue
Please note that this is using the SQLite default. Testing with MySQL should also be done to see the serialization issue.
What driver are you using?
MySQL
MikroORM version
next
Node.js version
20.9.0
Operating system
5.15.146.1-microsoft-standard-WSL2
Validations
The text was updated successfully, but these errors were encountered: