Replies: 1 comment 11 replies
-
Not sure if I understand the use case here, why would you have a random database value and stable runtime value? If you can describe the use case I can suggest some workarounds. The change tracking works based on the database values, as that is what we know how to compare, as opposed to the runtime values which can be pretty much anything. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
We have custom type defined which works by parsing the value (for example equivalent operation is appending random number after string when saving to database (
convertToDatabaseValue
) and removing it inconvertToJSValue
function - so the two operations are not symmetrical, only in part of the output). However as the result ofconvertToDatabaseValue
is random, it causes mikro orm to immediately update all hydrated entities as soon as.flush()
is called, is it possible toTo Reproduce
Steps to reproduce the behavior:
Use type such as this: (define randint however you want)
Use the type as a property and fetch such values.
Flush the EntityManager, you'll see updates for the fetched entities.
Expected behavior
Ability to set check on JS values, define custom comparator or simply not updating the first fetched values
Versions
Beta Was this translation helpful? Give feedback.
All reactions