Skip to content

Commit

Permalink
Merge pull request #7905 from Stypox/fix-room-unused-columns
Browse files Browse the repository at this point in the history
Fix Room warning about unused columns during build
  • Loading branch information
litetex authored Feb 26, 2022
2 parents 5be40f6 + a8a96b7 commit 46fad32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import androidx.annotation.Nullable;
import androidx.room.Dao;
import androidx.room.Query;
import androidx.room.RewriteQueriesToDropUnusedColumns;

import org.schabi.newpipe.database.history.model.StreamHistoryEntity;
import org.schabi.newpipe.database.history.model.StreamHistoryEntry;
Expand Down Expand Up @@ -67,6 +68,7 @@ public Flowable<List<StreamHistoryEntity>> listByService(final int serviceId) {
@Query("DELETE FROM " + STREAM_HISTORY_TABLE + " WHERE " + JOIN_STREAM_ID + " = :streamId")
public abstract int deleteStreamHistory(long streamId);

@RewriteQueriesToDropUnusedColumns
@Query("SELECT * FROM " + STREAM_TABLE

// Select the latest entry and watch count for each stream id on history table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import androidx.room.Dao;
import androidx.room.Query;
import androidx.room.RewriteQueriesToDropUnusedColumns;
import androidx.room.Transaction;

import org.schabi.newpipe.database.BasicDAO;
Expand Down Expand Up @@ -52,6 +53,7 @@ default Flowable<List<PlaylistStreamEntity>> listByService(final int serviceId)
+ " WHERE " + JOIN_PLAYLIST_ID + " = :playlistId")
Flowable<Integer> getMaximumIndexOf(long playlistId);

@RewriteQueriesToDropUnusedColumns
@Transaction
@Query("SELECT * FROM " + STREAM_TABLE + " INNER JOIN "
// get ids of streams of the given playlist
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.RewriteQueriesToDropUnusedColumns
import androidx.room.Transaction
import io.reactivex.rxjava3.core.Flowable
import io.reactivex.rxjava3.core.Maybe
Expand Down Expand Up @@ -31,6 +32,7 @@ abstract class SubscriptionDAO : BasicDAO<SubscriptionEntity> {
)
abstract fun getSubscriptionsFiltered(filter: String): Flowable<List<SubscriptionEntity>>

@RewriteQueriesToDropUnusedColumns
@Query(
"""
SELECT * FROM subscriptions s
Expand All @@ -47,6 +49,7 @@ abstract class SubscriptionDAO : BasicDAO<SubscriptionEntity> {
currentGroupId: Long
): Flowable<List<SubscriptionEntity>>

@RewriteQueriesToDropUnusedColumns
@Query(
"""
SELECT * FROM subscriptions s
Expand Down

0 comments on commit 46fad32

Please sign in to comment.