[ad_1]
Yo guys, right here is my situation…i’ve two equivalent schema sqlite databases in my iOS app:
1.main(all the time recent/preloaded)
2.backup with some saved person knowledge(favorites, and so on.)in desk columns,… my purpose is to replace all this particular main desk columns with saved person knowledge columns from backup database however provided that id’s for desk row from each are the identical. My concept is one thing like this:
for loopNewEvent in primaryDB {
for loopOldEvent in backupDB {
guard loopOldEvent.id == loopNewEvent.id else { proceed }
loopNewEvent.favourite = loopOldEvent.favourite
break
}
}
Can anybody assist me find out how to do it in sqlite3 utilizing ATTACH.
Thanks
[ad_2]
