Search custom labels

This commit is contained in:
MM20
2022-09-13 20:53:46 +02:00
parent f3c1cc8dcd
commit 15837b0cdc
8 changed files with 112 additions and 36 deletions
@@ -19,4 +19,7 @@ interface CustomAttrsDao {
@Query("SELECT * FROM CustomAttributes WHERE type = :type AND key IN (:keys)")
fun getCustomAttributes(keys: List<String>, type: String) : Flow<List<CustomAttributeEntity>>
@Query("SELECT DISTINCT key FROM CustomAttributes WHERE (type = 'label' OR type = 'tag') AND value LIKE :query")
fun search(query: String): Flow<List<String>>
}
@@ -106,6 +106,9 @@ interface SearchDao {
@Query("SELECT * FROM Searchable WHERE `key` = :key")
fun getFavorite(key: String): FavoritesItemEntity?
@Query("SELECT * FROM Searchable WHERE `key` IN (:keys)")
fun getFromKeys(keys: List<String>): List<FavoritesItemEntity>
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertReplaceExisting(toDatabaseEntity: FavoritesItemEntity)