rewrite dbwrapper with coffee