title: How to observe database delete events with Architecture Components
body: <p>I have a DAO as follows.</p>
  
  <pre><code>@Dao
  public interface PostDAO {
      @Query("SELECT * FROM posts order by time DESC")
      LiveData&lt;List&lt;Post&gt;&gt; getPosts();
  
      @Insert(onConflict = OnConflictStrategy.REPLACE)
      @NonNull
      void insert(Post... posts);
  
      @Delete
      void delete(Post post);
  
      @Query("SELECT * FROM posts WHERE id = :id")
      Post getPost(String id);
  
      @Query("SELECT * FROM posts WHERE id = :id")
      LiveData&lt;Post&gt; getPostLiveData(String id);
  }
  </code></pre>
  
  <p>I understand that I can listen for new added data with something like the following.</p>
  
  <pre><code>postDAO().getPosts().observe(builder.getLifecycleOwner(), data::postValue)
  </code></pre>
  
  <p>But how can I know when a post has been deleted?</p>