Update an unknown table based on inheritance #2930
Unanswered
ArthurValada
asked this question in
Q&A
Replies: 1 comment
-
You can always use the runtime schema introspection APIs for this. I think you can even get some type safety here by writing a generic method like this (where Future<void> updateCommonField<T extends TableInfo<A, D>, D>(T table,) {
// ...
} That allows you to call |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there.
I would like to know if, using Drift, it is possible to update a row from an unknown table based on the table it inherits from. That is, let A be an abstract table with attributes a1, a2, a3, ... from which B and C inherit all attributes, is it possible to write a generic method that allows updating B or C based on the argument of the past type? I face this problem considering that many of my tables have common attributes, so I prefer to use inheritance to avoid repetition.
Beta Was this translation helpful? Give feedback.
All reactions