how can we observe specific changes made to SQLDeLight DB and emit them?
Asked Answered
D

0

6

This is my table structure

CREATE TABLE Missions(
    MissionID INTEGER NOT NULL UNIQUE,
    MilestoneID INTEGER NOT NULL,
    MissionExpiry TEXT,
    MissionStatus TEXT,
    Count INTEGER DEFAULT 0,
    MilestoneList TEXT,
    UpdatedTime TEXT,

    PRIMARY KEY (MissionID),
    CONSTRAINT fk_milestone FOREIGN KEY(MilestoneID)  REFERENCES Milestone(MilestoneID)
);

I want to emit an event whenever the count attribute gets updated in the above table.

I have written a query like this:

Val allItems: Flow<List<Item>> =
ItemQueries.selectAll().asFlow().mapToList()

But the flow is triggering whenever there is insertion or updation on any attribute inside the table and all rows are getting fetched. I want to fetch only the rows that are updated not all rows. How can I get it done?

Diverting answered 27/5, 2022 at 9:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.