anchor.diff:      {ok, State}.
   
   
  +-spec server_ref() -> ServerRef :: term().
   server_ref() ->
       %% @todo: make this URL configurable
       Url = "http://localhost:5984",
       Options = [],
       couchbeam:server_connection(Url, Options).
   
  +-spec db_ref(DBName :: dbname()) -> DBRef :: term().
   db_ref(DBName) ->
       {ok, DBRef} = couchbeam:open_db(server_ref(), encode_dbname(DBName)),
       DBRef.
   
  -
  +-spec encode_dbname(dbname()) -> binary().
   encode_dbname(Bin) ->
       list_to_binary([ 97 + Char || <<Char:4>> <= Bin]).
   
  +-spec decode_dbname(binary()) -> dbname().
   decode_dbname(DBName) ->
  -    << <<Char:4>> || Char <- [ Char - 97 || <<Char:8>> <= DBName]>>.
  -
  -
  -ensure_deps_started() ->
  -    case hackney:start() of
  -        ok ->
  -            ok;
  -        {error, {already_started, _}} ->
  -            ok
  -    end,
  -
  -    case application:start(couchbeam) of
  -        ok ->
  -            ok;
  -        {error, {already_started, _}} ->
  -            ok
  -    end.+    << <<Char:4>> || Char <- [ Char - 97 || <<Char:8>> <= DBName]>>.
positive.code:             {error, Reason}
      end.
  
  
  list_docs(DBName, Limit) ->
      case couchbeam_changes:follow_once(db_ref(DBName), [{descending, true}, include_docs, {limit, Limit}]) of
          {ok, _, Docs} ->
  
negative.code: ]).
  
  -define(SERVER, ?MODULE).
  
  %% Local types
  -type simple_doc() :: #{binary() => binary()}.
  -type dbname() :: binary().
  
  %% API functions
  
  start_link(_Opts) ->
      gen_server:start_link({local, ?SERVER}, ?MODULE, [], []).
  
  
  -spec list_dbs() -> {ok, [dbname()]} | no_return().
  list_dbs() ->
      case couchbeam:all_dbs(server_ref()) of
          {ok, DBList} ->
  