summaryrefslogtreecommitdiff
path: root/src/fabric_rpc.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/fabric_rpc.erl')
-rw-r--r--src/fabric_rpc.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl
index 04aebfd1..1a2edf77 100644
--- a/src/fabric_rpc.erl
+++ b/src/fabric_rpc.erl
@@ -3,6 +3,7 @@
-export([get_db_info/1, get_doc_count/1, get_update_seq/1]).
-export([open_doc/3, open_revs/4, get_missing_revs/2, update_docs/3]).
-export([all_docs/2, changes/3, map_view/4, reduce_view/4, group_info/2]).
+-export([create_db/3, delete_db/3]).
-include("fabric.hrl").
@@ -136,6 +137,19 @@ reduce_view(DbName, Group0, ViewName, QueryArgs) ->
end,
rexi:reply(complete).
+create_db(DbName, Options, Doc) ->
+ mem3_util:write_db_doc(Doc),
+ rexi:reply(case couch_server:create(DbName, Options) of
+ {ok, _} ->
+ ok;
+ Error ->
+ Error
+ end).
+
+delete_db(DbName, Options, DocId) ->
+ mem3_util:delete_db_doc(DocId),
+ rexi:reply(couch_server:delete(DbName, Options)).
+
get_db_info(DbName) ->
with_db(DbName, [], {couch_db, get_db_info, []}).