diff options
Diffstat (limited to 'app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java')
-rw-r--r-- | app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java index 7837aa42..ed77c65c 100644 --- a/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java +++ b/app/src/main/java/SubscribedSubredditDatabase/SubscribedSubredditDao.java @@ -18,4 +18,10 @@ public interface SubscribedSubredditDao { @Query("SELECT * from subscribed_subreddits ORDER BY name COLLATE NOCASE ASC") LiveData<List<SubscribedSubredditData>> getAllSubscribedSubreddits(); + + @Query("SELECT * from subscribed_subreddits WHERE name = :subredditName LIMIT 1") + SubscribedSubredditData getSubscribedSubreddit(String subredditName); + + @Query("DELETE FROM subscribed_subreddits WHERE name = :subredditName") + void deleteSubscribedSubreddit(String subredditName); } |