How to wrap the database writer so that `ctx.db.patch` and `ctx.db.insert` run side effects
I was trying to do it inside rules but quickly realized that's not possible...
This is what my mental model wanted to do:
Problems:
1. cannot do mutations inside the handlers
2. field._id is not yet available
