Right now we cheat with a Table::db(&self) -> DatabaseOperator helper method.
Maybe each table could store the DatabaseOperator and implement Deref<Target = DatabaseOperator>? That would allow to do something like:
let magnet_operator = category_operator.magnet();
Is that useful? Is that confusing? Is it better to stay explicit with the category_operator.db().magnet() instruction?
Also worth noting that we currently do a lot of cloning which is not really a problem given we don't have many requests, but we maybe could avoid that with some lifetime magic.
Right now we cheat with a
Table::db(&self) -> DatabaseOperatorhelper method.Maybe each table could store the
DatabaseOperatorand implementDeref<Target = DatabaseOperator>? That would allow to do something like:Is that useful? Is that confusing? Is it better to stay explicit with the
category_operator.db().magnet()instruction?Also worth noting that we currently do a lot of cloning which is not really a problem given we don't have many requests, but we maybe could avoid that with some lifetime magic.