|
|
|
@ -24,10 +24,10 @@ interface BookDao { |
|
|
|
|
@Query("SELECT * FROM books WHERE (`group` & :group) > 0") |
|
|
|
|
fun observeByGroup(group: Long): LiveData<List<Book>> |
|
|
|
|
|
|
|
|
|
@Query("select * from books where (SELECT sum(groupId) FROM book_groups) & `group` = 0") |
|
|
|
|
@Query("select * from books where (SELECT sum(groupId) FROM book_groups where groupId > 0) & `group` = 0") |
|
|
|
|
fun observeNoGroup(): LiveData<List<Book>> |
|
|
|
|
|
|
|
|
|
@Query("select count(bookUrl) from books where (SELECT sum(groupId) FROM book_groups) & `group` = 0") |
|
|
|
|
@Query("select count(bookUrl) from books where (SELECT sum(groupId) FROM book_groups where groupId > 0) & `group` = 0") |
|
|
|
|
fun observeNoGroupSize(): LiveData<Int> |
|
|
|
|
|
|
|
|
|
@Query("SELECT * FROM books WHERE name like '%'||:key||'%' or author like '%'||:key||'%'") |
|
|
|
|