anchor.diff:  foldr(_DB, _Fun, Acc, {_, End, Start, _}, _MaxNum) when Start < End -> Acc;
   foldr(DB, Fun, Acc, {El}, _MaxNum) ->
       case mnesia:transaction(fun()-> mnesia:read(DB, El) end) of
  -      {atom, []} ->
  +      {atomic, []} ->
               Acc;
  -      {atom, [_Entry]} ->
  +      {atomic, [_Entry]} ->
               Fun(El, Acc)
       end;
   foldr(DB, Fun, Acc, all, MaxNum) ->
  
positive.code:     {atomic, Next} = mnesia:transaction(fun()-> mnesia:next(DB, Start) end),
      foldl_iter(DB, Fun, Fun(Start, Acc), {'[', Next, End, ']'}, MaxNum - 1).
  
  %% @doc Is equivalent to ets:foldr(Fun, Acc0, DB).
  -spec foldr(db(), fun((Key::key(), AccIn::A) -> AccOut::A), Acc0::A) -> Acc1::A.
  foldr(DB, Fun, Acc) ->
      {atomic, First} = mnesia:transaction(fun()-> mnesia:first(DB) end),
      {atomic, Last} = mnesia:transaction(fun()-> mnesia:last(DB) end),
      foldr(DB, Fun, Acc, {'[', First, Last, ']'}, mnesia:info(DB, size)).
  
  %% @doc Is equivalent to foldr(DB, Fun, Acc0, Interval, get_load(DB)).
  -spec foldr(db(), fun((Key::key(), AccIn::A) -> AccOut::A), Acc0::A, db_backend_beh:interval()) -> Acc1::A.
  foldr(DB, Fun, Acc, Interval) ->
      foldr(DB, Fun, Acc, Interval, mnesia:info(DB, size)).
  
  %% @doc Behaves like foldl/5 with the difference that it starts at the end of
  %%      Interval and iterates towards the start of Interval.
  
negative.code: %% -define(TRACE(X, Y), ct:pal(X, Y)).
  
  %% primitives
  -export([start/0, new/1, new/2, open/1, close/1, put/2, get/2, delete/2]).
  %% db info
  -export([get_name/1, get_load/1]).
  %% cleanup functions
  -export([mnesia_tables_of/1, delete_mnesia_tables/1, close_and_delete/1]).
  
  %% iteration
  -export([foldl/3, foldl/4, foldl/5]).
  