! Copyright (C) 2008, 2009 Alex Chapman
! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs continuations debugger hashtables http
+USING: accessors assocs continuations debugger fry hashtables http
http.client io io.encodings.string io.encodings.utf8 json.reader
json.writer kernel locals make math math.parser namespaces sequences
-strings urls urls.encoding vectors ;
+strings urls.encoding vectors ;
IN: couchdb
! NOTE: This code only works with the latest couchdb (0.9.*), because old
f swap db-url couch-put response-ok* ;
: ensure-db ( db -- )
- [ create-db ] [
- dup file-exists-error? [ 2drop ] [ rethrow ] if
- ] recover ;
+ '[ _ create-db ] [ file-exists-error? ] ignore-error ;
: delete-db ( db -- )
db-url couch-delete drop ;