Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
interface PostApiService {
fun getFeed(): Single<Response<List<Post>>>
interface PostDao {
@Insert(onConflict = OnConflictStrategy.IGNORE)
fun insert(post: Post): Long
@Update(onConflict = OnConflictStrategy.REPLACE)
fun update(post: Post)
fun upsert(post: Post) {
if (-1L == insert(post))
@Query("SELECT * FROM `post`")
fun getPostList(): Observable<List<Post>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment