knadh / localStorageDB

A simple database layer for localStorage and sessionStorage for creating structured data in the form of databases and tables
http://nadh.in/code/localstoragedb
814 stars 128 forks source link

Testing db integrity #62

Closed danbuntu closed 8 years ago

danbuntu commented 8 years ago

As some point I've made a mistake in my app and the db has become corrupt and I get a warning in the the console.

'unexpected string'

You can simulate this by just manually removing one of the characters.

Is there a best way to test and possibly fix the integrity of the database?

knadh commented 8 years ago

@danbuntu the library should not corrupt the serialised data stored (JSON) in the database as it doesn't do any string manipulation, and it doesn't expose any methods to do so either. If the stored data is indeed somehow corrupted, there is no way to correct it without manually fixing it. Thanks.