Added support for database flag in db task