Adds next_id method for DatabaseIO