How to query for all changed records including deleted status
See original GitHub issueI would like to have a counter to know how many items we need to sync to the backend? And i would like to use the enhance options with withObservables like so
const uploadButtonObservable = withObservables<
UploadButtonPropsIn,
UploadButtonPropsOut
>([], () => {
const collection = database.collections.get(tableName);
return {
changedCount: collection
.query(Q.where('_status', Q.notEq('synced')))
.observeCount(),
};
});
The problem is that by default the query is extend to exclude _status = ‘deleted’
So How should I tackle this?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Find Modified/New/Deleted Records Between Two Tables
-- DELETED SELECT B.*, 'DELETED' AS 'CHANGE_TYPE' FROM TableB B LEFT JOIN TableA A ...
Read more >Query Deleted Records in Salesforce: 3 Easy Methods - Learn
To access all the records irrespective of their deletion status, Salesforce requires one to use the QUERY ALL construct.
Read more >How to track the history of data changes using SQL Server ...
In this blog post, you are going to see how to track the history of data changes using SQL Server 2016 System-Versioned Temporal...
Read more >SCCM Audit Status Messages Track Who Deleted Modified ...
Launch the SCCM console and navigate via \Monitoring\Overview\System Status\Status Message Queries. Make sure you filter the status message ...
Read more >Create and run a delete query - Microsoft Support
The DELETE statement is used to delete records in a table. See how to create and use a delete query in Access desktop...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
you can use https://github.com/Nozbe/WatermelonDB/blob/master/src/Database/index.js#L178 to get a signal whenever there’s a change in the DB, upon which you can refetch the value
If there was a way to get the data without this risk I would use it. Problem is that there are possibly multiple projects to sync separately explaining the need for the where clause. I could possibly start a new database per project and drop some raw queries, but not all