anchor.diff:  
   
   %%% Internal
  -encode_key(K, #kyte_db_args{
  -	key_codec = C
  -}) ->
  -	encode_with(C, K).
  -
  -encode_value(V, #kyte_db_args{
  -	val_codec = C
  -}) ->
  -	encode_with(C, V).
  -
  -encode_with(C, V) ->
  -	case C of
  -		raw ->
  -			V;
  -		rawz ->
  -			zlib:zip(V);
  -		etf ->
  -			term_to_binary(V);
  -		etfz ->
  -			zlib:zip(term_to_binary(V));
  -		sext ->
  -			sext:encode(V)
  -	end.
  -
  -decode_value(V, #kyte_db_args{
  -	val_codec = C
  -}) ->
  -	decode_with(C, V).
  -
  -decode_with(C, V) ->
  -	case C of
  -		raw ->
  -			V;
  -		rawx ->
  -			zlib:unzip(V);
  -		etf ->
  -			binary_to_term(V);
  -		etfz ->
  -			binary_to_term(zlib:unzip(V));
  -		sext ->
  -			sext:decode(V)
  -	end.
  -
  -choose_partition(K, HF, Parts) ->
  -	Kh = HF(K),
  -	Bits = size(Kh) * 8,
  -	<<Hash:Bits/unsigned>> = Kh,
  -	PartIdx = ( Hash rem length(Parts) ) + 1,
  -	{ok, lists:nth(PartIdx, Parts)}.
   
   start_single_partition(Pool, DbFile) ->
   	case supervisor:start_child(kyte_db_sup, [Pool, DbFile]) of
  
positive.code: 	file = DbFile,
  	parts = { PreOrPost, PartsCount, _HF }
  }) when (PreOrPost == pre_hash) or (PreOrPost == post_hash) ->
  	Partitions = lists:map(fun(Idx) ->
  		PartFile = lists:flatten(io_lib:format(DbFile, [Idx])),
  		{ ok, DbSrv } = start_single_partition(Pool, PartFile),
  		DbSrv
  	end, lists:seq(1, PartsCount)),
  	{ ok, {Partitions, Args} }.
  
  db_close({DbSrv, #kyte_db_args{ parts = single }}) ->
  
negative.code: db_get({Parts, Args = #kyte_db_args{ parts = { post_hash, PartsCount, HF } }}, K) ->
  	PartsCount = length(Parts),
  
  	Kt = kyte_codec:encode_key(K, Args),
  	kyte_parts:with_partition(Kt, HF, Parts, fun(DbSrv) ->
  		case gen_server:call(DbSrv, {db_get, Kt}, infinity) of
  			{ok, Vt} ->
  				{ok, kyte_codec:decode_value(Vt, Args)};
  			Other ->
  				Other
  		end
  	end).
  
  
  db_del({DbSrv, Args = #kyte_db_args{ parts = single }}, K) ->
  	Kt = kyte_codec:encode_key(K, Args),
  	gen_server:call(DbSrv, {db_remove, Kt}, infinity);
  
  db_del({Parts, Args = #kyte_db_args{ parts = { post_hash, PartsCount, HF } }}, K) ->
  	PartsCount = length(Parts),
  
  	Kt = kyte_codec:encode_key(K, Args),
  	kyte_parts:with_partition(Kt, HF, Parts, fun(DbSrv) ->
  		gen_server:call(DbSrv, {db_remove, Kt}, infinity)
  	end).
  
  
  
  