Use a macro for db calls