Computed columns #1803
Replies: 5 comments
-
This seems really helpful i would really like to have this as a feature as well ! |
Beta Was this translation helpful? Give feedback.
-
+1 for a PIP. I think the behaviour should be divided into on_insert and on_update (and on_change combines both) and the implementation should introduce a proper "prepare for insert/update" stage. |
Beta Was this translation helpful? Give feedback.
-
@tyt2y3 thanks for seeing a usecase for this but as i understand queries of computed columns would not be ran at all oninsert / onupdate they are just there to combine seperate queries into the model on selection of a row. |
Beta Was this translation helpful? Give feedback.
-
Any news? :) Id be glad to help but i dont where to start at all |
Beta Was this translation helpful? Give feedback.
-
Any news? :) |
Beta Was this translation helpful? Give feedback.
-
Motivation
Ive integrated sea orm in a quite complex project where the need arises for computed columns from different tables.
Proposed Solutions
A potential solution could be to have a computed column annotated on the model (which is not included in the derived active model) and just link a function which gets called on every selection of the model:
Additional Information
I think this would be pretty useful to a lot of realworld applications, what do you think about this? 🙂
Beta Was this translation helpful? Give feedback.
All reactions