Add support for database compaction.

This commit is contained in:
Nolan Darilek 2008-12-14 17:29:15 -06:00
parent 12c09085df
commit dd7f109878
2 changed files with 17 additions and 2 deletions

View file

@ -149,7 +149,12 @@ module CouchRest
slug = CGI.escape(doc['_id'])
CouchRest.delete "#{@root}/#{slug}?rev=#{doc['_rev']}"
end
# Compact the database, removing old document revisions and optimizing space use.
def compact!
CouchRest.post "#{@root}/_compact"
end
# DELETE the database itself. This is not undoable and could be rather
# catastrophic. Use with care!
def delete!