You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/02/01 17:45:56 UTC

chttpd commit: updated refs/heads/COUCHDB-3287-pluggable-storage-engines to 0ac066c

Repository: couchdb-chttpd
Updated Branches:
  refs/heads/COUCHDB-3287-pluggable-storage-engines [created] 0ac066c96


Support engine selection from the HTTP API


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/0ac066c9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/0ac066c9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/0ac066c9

Branch: refs/heads/COUCHDB-3287-pluggable-storage-engines
Commit: 0ac066c9645f7f5234e5726b6a9f94ae17ad0f17
Parents: 90648a2
Author: Paul J. Davis <pa...@gmail.com>
Authored: Wed Apr 6 10:48:01 2016 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Wed Feb 1 11:04:37 2017 -0600

----------------------------------------------------------------------
 src/chttpd_db.erl | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/0ac066c9/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index f3dd2ab..e932c1c 100644
--- a/src/chttpd_db.erl
+++ b/src/chttpd_db.erl
@@ -284,8 +284,15 @@ create_db_req(#httpd{}=Req, DbName) ->
     N = chttpd:qs_value(Req, "n", config:get("cluster", "n", "3")),
     Q = chttpd:qs_value(Req, "q", config:get("cluster", "q", "8")),
     P = chttpd:qs_value(Req, "placement", config:get("cluster", "placement")),
+    E = iolist_to_binary(chttpd:qs_value(Req, "engine", "couch")),
+    Options = [
+        {n, N},
+        {q, Q},
+        {placement, P},
+        {engine, E}
+    ],
     DocUrl = absolute_uri(Req, "/" ++ couch_util:url_encode(DbName)),
-    case fabric:create_db(DbName, [{n,N}, {q,Q}, {placement,P}]) of
+    case fabric:create_db(DbName, Options) of
     ok ->
         send_json(Req, 201, [{"Location", DocUrl}], {[{ok, true}]});
     accepted ->