Last active
June 15, 2017 13:51
-
-
Save TKolbusz/5e1f0da09917c61bfc47ee478fa90d52 to your computer and use it in GitHub Desktop.
Controlling database flow using Room and RxJava2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Dao | |
interface ItemDao { | |
@Query("SELECT name, place, description, date_added_ms FROM items") | |
fun getAllItems(): Flowable<List<Item>> | |
@Query("SELECT name FROM items WHERE place = :arg0") | |
fun getItemsAt(place: String): Flowable<List<Item>> | |
@Insert(onConflict = OnConflictStrategy.REPLACE) | |
fun insertItem(item: Item) | |
@Delete | |
fun deleteItem(item: Item) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment