You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2019/11/14 23:17:23 UTC

[couchdb] branch prototype/fdb-layer updated: Assert Db handle field existence in `load_config/1` in fabric2_fdb

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/prototype/fdb-layer by this push:
     new b58dc30  Assert Db handle field existence in `load_config/1` in fabric2_fdb
b58dc30 is described below

commit b58dc3032e5c154be9ea517b9ed225efb3f2f409
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Thu Nov 14 18:13:46 2019 -0500

    Assert Db handle field existence in `load_config/1` in fabric2_fdb
    
    Forgot to push this in the previous PR so made a new commit.
    
    https://github.com/apache/couchdb/pull/2300#discussion_r346592418
---
 src/fabric/src/fabric2_fdb.erl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/fabric/src/fabric2_fdb.erl b/src/fabric/src/fabric2_fdb.erl
index 97f0bc9..0d74138 100644
--- a/src/fabric/src/fabric2_fdb.erl
+++ b/src/fabric/src/fabric2_fdb.erl
@@ -212,8 +212,10 @@ open(#{} = Db0, Options) ->
         db_prefix => DbPrefix,
         db_version => DbVersion,
 
+        uuid => <<>>,
         revs_limit => 1000,
         security_doc => {[]},
+
         user_ctx => UserCtx,
 
         % Place holders until we implement these
@@ -369,9 +371,9 @@ load_config(#{} = Db) ->
     lists:foldl(fun({K, V}, DbAcc) ->
         {?DB_CONFIG, Key} = erlfdb_tuple:unpack(K, DbPrefix),
         case Key of
-            <<"uuid">> ->  DbAcc#{uuid => V};
-            <<"revs_limit">> -> DbAcc#{revs_limit => ?bin2uint(V)};
-            <<"security_doc">> -> DbAcc#{security_doc => ?JSON_DECODE(V)}
+            <<"uuid">> ->  DbAcc#{uuid := V};
+            <<"revs_limit">> -> DbAcc#{revs_limit := ?bin2uint(V)};
+            <<"security_doc">> -> DbAcc#{security_doc := ?JSON_DECODE(V)}
         end
     end, Db, erlfdb:wait(Future)).