Room persistance library. Delete all

前端 未结 8 1128
再見小時候
再見小時候 2020-12-04 11:59

How can I delete all entries on specific table using Room Persistence Library? I need to drop table, but I cannot to find any information how to do this.

Only when d

8条回答
  •  没有蜡笔的小新
    2020-12-04 12:26

    You can create a DAO method to do this.

    @Dao 
    interface MyDao {
        @Query("DELETE FROM myTableName")
        public void nukeTable();
    }
    

提交回复
热议问题