Extract ID generation from `Mapper#insert`