On Oct 15, 2015, at 11:48 AM, Alexander Selling 
<[email protected]<mailto:[email protected]>> wrote:

Since CBL fails to process _removed from SG sometimes I've tried my best to 
find a way to get rid of corrupted documents.

I think you’re referring to issue 
#776<https://github.com/couchbase/couchbase-lite-ios/pull/776>? That was fixed 
in 1.1.1.

Purging is out of the question since it requires a compact,

No, it doesn’t. You can purge without running a compact.

and only after a day or two of usage my users have more data than what is 
reasonable to run a compact on.

If you don’t compact, the database storage will grow continuously, which is 
bad. Can you describe the problem you’re having with compaction?

If I had access to the revs table it would be super easy, grab the json body in 
the revs table and remove the underscores. However some db-function(?) is 
missing so I can't query the revs table,

CBL defines some custom SQL functions like the JSON collator. If you open the 
database in the sqlite3 command-line tool, there are some queries that won’t 
run there because of course that function isn’t defined.

I've tried to just rename the docid since it points to the offending row in the 
revs table. Thinking that it would cut off the corrupted rev and leave it 
hanging in empty space, however CBL seems to be going through the revs table 
looking for underscores without doing a lookup in the docs table so that didn't 
help at all.

Please don’t grope into the SQLite database, since there’s no limit to what 
could go wrong. Obviously we can’t stop you, but we’re not going to offer help. 
If you want to make significant changes or additions to what CBL can do, it 
would be better to add them as new features in CBL itself.

Do you think it would be faster to compact the database or to create a new 
database and write all the latest revs into the new database?

I don’t know; you could try it easily enough. The latter is equivalent to doing 
a push replication into a new empty local database.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/7B6FE428-CA6E-4E2A-AA45-CFFC0C4E904B%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to