diff options
author | Nick Vatamaniuc <vatamane@apache.org> | 2019-11-14 18:13:46 -0500 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2019-11-14 18:17:13 -0500 |
commit | b58dc3032e5c154be9ea517b9ed225efb3f2f409 (patch) | |
tree | b1bcd47760dd9ed63f24ce1fcfbdf668b96c1308 | |
parent | 44f660f157a61a87e773990abc907f8c55883160 (diff) | |
download | couchdb-b58dc3032e5c154be9ea517b9ed225efb3f2f409.tar.gz |
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
-rw-r--r-- | src/fabric/src/fabric2_fdb.erl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fabric/src/fabric2_fdb.erl b/src/fabric/src/fabric2_fdb.erl index 97f0bc921..0d741385c 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)). |