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/03 16:48:31 UTC
[2/2] chttpd commit: updated
refs/heads/COUCHDB-3287-pluggable-storage-engines to fb73a5d
Support engine selection from the HTTP API
COUCHDB-3287
Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/fb73a5d3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/fb73a5d3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/fb73a5d3
Branch: refs/heads/COUCHDB-3287-pluggable-storage-engines
Commit: fb73a5d3f9a4b11447852035f6ea0a5fc59b9a4a
Parents: dddab3f
Author: Paul J. Davis <pa...@gmail.com>
Authored: Wed Apr 6 10:48:01 2016 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Fri Feb 3 10:48:09 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/fb73a5d3/src/chttpd_db.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_db.erl b/src/chttpd_db.erl
index 5a26e2d..b8e6965 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 ->