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

In query field setters not called when database value is same as default value of property #1229

Open
PrivateFlip opened this issue Jun 3, 2024 · 0 comments

Comments

@PrivateFlip
Copy link

When a query is done from the database were the value of the field is equal to the default value of the property. This seems to have introduced in version v1.8.116. It seems efficient to not set a value for a property which already has this exact same value. In our code however we have functionalities where for a property we register original value and if it is later changed the updated value. This allows us to see which fields have been changed. We are making us of a property bag construction in which this functionality is implemented. The original value is implied to be the first time the setter is called. After this version of sqlite the setter is not always called. This prevents the original value for fields which have the default value to not be set, and no change to be detected if a change is made.

This update changes the behavior and there is no way to detect whether a property was not requested in the query which filled the object instance or whether the field has a default value in the database. Of course it is known which fields were queried, but this used to be something which could be handled in an automatic way.

Was this an intentional functional change? The behavior seems to be introduced with the fast setters update and as such has been active for several years. Up till now our team was on a much older version, because at some point a change was made were each setter of each mapped field was always called even when the field was not part of the query (kinda the opposite of what is happening now). This at the time prevented us from updating to a newer version. In the last versions this behavior is no longer present.

Version 1.7.335 works fine for us and has neither behavior: all setters which are part of the query are called and all only those setters are called.

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

1 participant