Linked Questions

Popular Questions

I often find my self calculating difference between remote local data (result = items only in remotes are inserts, items only in locals are deletes, rest is updates).

Its very simple algo in higher level language:

query remotes
query locals

for local in locals
   if local is found in remotes
       to_update += remote
       remotes -= local
   else
       to_delete += local

to_insert = remotes

for _ in to_insert
  sql insert

for _ in to_update
  sql update

for _ in to_delete
  sql delete

Is there a way to do this only inside sqlite database without any java/kotlin?

Thanks

Related Questions