wrap some calls in defer.maybeDeferred for non-blocking postgres and sqlite compatibility