From 5c1c2422dcf9673d67681f999ece72a019461306 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Wed, 14 Jul 2010 14:49:22 -0400 Subject: support for revs_limit and security metadata --- src/fabric.erl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/fabric.erl') diff --git a/src/fabric.erl b/src/fabric.erl index 5d03c5fa..1be97a98 100644 --- a/src/fabric.erl +++ b/src/fabric.erl @@ -5,7 +5,8 @@ % DBs -export([all_dbs/0, all_dbs/1, create_db/1, create_db/2, delete_db/1, - delete_db/2, get_db_info/1, get_doc_count/1]). + delete_db/2, get_db_info/1, get_doc_count/1, set_revs_limit/3, + set_security/3, get_revs_limit/1, get_security/1]). % Documents -export([open_doc/3, open_revs/4, get_missing_revs/2, update_doc/3, @@ -57,6 +58,19 @@ delete_db(DbName) -> delete_db(DbName, Options) -> fabric_db_delete:go(dbname(DbName), opts(Options)). +set_revs_limit(DbName, Limit, Options) when is_integer(Limit), Limit > 0 -> + fabric_db_meta:set_revs_limit(dbname(DbName), Limit, opts(Options)). + +get_revs_limit(DbName) -> + {ok, Db} = fabric_util:get_db(dbname(DbName)), + try couch_db:get_revs_limit(Db) after catch couch_db:close(Db) end. + +set_security(DbName, SecObj, Options) -> + fabric_db_meta:set_security(dbname(DbName), SecObj, opts(Options)). + +get_security(DbName) -> + {ok, Db} = fabric_util:get_db(dbname(DbName)), + try couch_db:get_security(Db) after catch couch_db:close(Db) end. % doc operations open_doc(DbName, Id, Options) -> -- cgit v1.2.3