nickva commented on a change in pull request #1017: Allow replicator documents
to include params for db creation
URL: https://github.com/apache/couchdb/pull/1017#discussion_r153502786
##########
File path: src/couch_replicator/src/couch_replicator_api_wrap.erl
##########
@@ -68,20 +68,25 @@ db_uri(Db) ->
db_open(Db, Options) ->
- db_open(Db, Options, false).
+ db_open(Db, Options, false, []).
-db_open(#httpdb{} = Db1, _Options, Create) ->
+db_open(#httpdb{} = Db1, _Options, Create, CreateParams) ->
{ok, Db} = couch_replicator_httpc:setup(Db1),
try
case Create of
false ->
ok;
true ->
- send_req(Db, [{method, put}],
+ Db2 = if CreateParams == [] -> Db; true ->
Review comment:
Let's pull this into a separate function and handle the CreateParams=[] in
the head.
`Db2 = maybe_append_create_query_params(Db, CreateParams)` ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services