Skip to content

Instantly share code, notes, and snippets.

@deepanshu42
Created May 23, 2020 09:50
Show Gist options
  • Save deepanshu42/481eb76083760ab80c91bc3c63a73384 to your computer and use it in GitHub Desktop.
Save deepanshu42/481eb76083760ab80c91bc3c63a73384 to your computer and use it in GitHub Desktop.
Room with RxJava Example
@Dao
interface UserDao {
@Query("SELECT * from users where uid = :id LIMIT 1")
fun loadUserById(id: Int): Flowable<User>
@Insert
fun insertUsers(vararg users: User): Completable
@Delete
fun deleteAllUsers(users: List<User>): Single<Int>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment