db: add get_return_id() and return markers