vendredi 29 avril 2016

Sqlite3 database corrupt - repair in Xamarin

I am getting a few (3/1400) db corruptions on an iOS app built using Xamarin.Forms.

When I look at the physical sqlite db, the size indicates content, and doing a dump returns a sql script with complete data, but ending like this

/**** ERROR: (11) database disk image is malformed *****/

at the point in time where corruption occurred.

Using this sqlite3 snippet I get a working copy of the database that is readable and queryable.

I would like to be able to make a copy of a corrupt db on the device, and then recover it using the second method on the iOS device itself, so remote users can continue working.

My question is: how do I get the sqlite3 command's equivalent on iOS in Xamarin Forms?

Aucun commentaire:

Enregistrer un commentaire