ropensci / sofa

Easy R interface to CouchDB
https://docs.ropensci.org/sofa/
33 stars 17 forks source link

Please make `delifexists = TRUE` possible, even if the db doesn't exist #39

Closed patperu closed 8 years ago

patperu commented 8 years ago

Hello Scott,

if I call db_create with delifexists = TRUE and the db does not exist, I'm getting an error.

library('sofa') # 0.1.8.9400

# db 'foo' doesn't exist
grep("foo", db_list(), value = TRUE)
# character(0)

db_create(cushion = "localhost", dbname = "foo", delifexists = TRUE)
# Error in sofa_DELETE(sprintf("http://127.0.0.1:%s/%s", cushion$port, dbname),  : 
#   Not Found (HTTP 404).

I would like to create the db foo every time I run the script. Right now I have to make the first function call with the default (delifexists = FALSE).

Best Patrick