code: def insert(self, thread):
          
          thread_id = thread['id']
          title = thread['title']
          self.db.threads.new(thread_id, title)
  
          comments = list(map(self._build_comment, thread['comments']))
          comments.sort(key=lambda comment: comment['id'])
          self.count += len(comments)
          for comment in comments:
              self.db.comments.add(thread_id, comment)
docs: Process a thread and insert its comments in the DB.