Add db_exception and db_type support to label_db backend