This is SQLite query i want to use in room database here is the first to try insert data and if data is already exist then update the data by using id
INSERT INTO books(id, title, author, year_published) VALUES(@id, @title, @author, @year_published)
ON DUPLICATE KEY UPDATE title = @title, author = @author;