anchor.diff:              EAdd
       end.
   
  -delete(Collection, Metric, Bucket, Key) ->
  +delete(Collection, Metric, Bucket, Key) when is_binary(Metric) ->
  +    delete(Collection, dproto:metric_to_list(Metric), Bucket, Key);
  +delete(Collection, Metric, Bucket, Key) when is_binary(Key) ->
  +    delete(Collection, Metric, Bucket, dproto:metric_to_list(Key));
  +delete(Collection, Metric, Bucket, Key)
  +  when is_binary(Collection),
  +       is_list(Metric),
  +       is_binary(Bucket),
  +       is_list(Key) ->
       Q = "DELETE FROM " ?MET_TABLE " WHERE collection = $1 AND " ++
           "metric = $2 AND bucket = $3 AND key = $4",
       Vs = [Collection, Metric, Bucket, Key],
  
positive.code: add(Collection, Metric, Bucket, Key, []) ->
      add(Collection, Metric, Bucket, Key);
  
  add(Collection, Metric, Bucket, Key, NVs) ->
      case add(Collection, Metric, Bucket, Key) of
          ok ->
              ok;
  
negative.code:                  {ok, MetricIdx::non_neg_integer()} |
                   {error, Error::term()}.
  
  add(Collection, Metric, Bucket, Key) when is_binary(Metric) ->
      add(Collection, dproto:metric_to_list(Metric), Bucket, Key);
  
  add(Collection, Metric, Bucket, Key) when is_binary(Key) ->
      add(Collection, Metric, Bucket, dproto:metric_to_list(Key));
  
  add(Collection, Metric, Bucket, Key)
    when is_binary(Collection),
         is_list(Metric),
         is_binary(Bucket),
         is_list(Key) ->
      Q = "INSERT INTO " ?MET_TABLE " (collection, metric, bucket, key) VALUES "
          "($1, $2, $3, $4) ON CONFLICT DO NOTHING RETURNING id",
      Vs = [Collection, Metric, Bucket, Key],
  