Generic model operations #68
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Consider making the CRUD operations on models more universal. For instance, implementing a generic function that returns all instances of the passed model from the corresponding table.
What could also be done is to have a
Model
trait with the CRUD methods.Furthermore, models could have a (not static) methods like
delete
calling the corresponding server functions with theirself
IDs passed in.Extending Diesel
Update: It seems this is not recommended. Read Composing applications with Diesel instead.