anchor.diff:  execute(Pid, Query, Values) ->
     trace("calling gen fsm to execute query"),
     gen_fsm:send_event(Pid, {self(), Query, Values}).
  +
  +prepare_update_data(Data) ->
  +  prepare_update_data(Data, [], [], 1).
  +
  +prepare_update_data([{Key, Val} | Tail], Columns, Vals, N) ->
  +  debug("adding ~w", [{Key, Val}]),
  +  prepare_update_data(
  +    Tail,
  +    Columns ++ "," ++ atom_to_list(Key) ++ "=$" ++ integer_to_list(N),
  +    [Val | Vals],
  +    N + 1);
  +prepare_update_data([], [$, | Columns], Vals, _N) ->
  +  {ok, Columns, lists:reverse(Vals)}.
   
   prepare_insert_data([]) ->
     {ok, [], [], []};
  
positive.code: select(Pid, {Schema, View, Filter, Opts}) ->
    select(Pid, Schema, View, Filter, Opts).
  
  function(Pid, {Schema, FunName, Params}) ->
    function(Pid, Schema, FunName, Params).
  
  
negative.code:   Values = [Value | Vals],
    prepare_insert_data(T, Columns, Params, Values, N + 1).
  
  prepare_select_data(Data) ->
    prepare_select_data(Data, 1).
  
  prepare_select_data([], _N) ->
    {ok, [], []};
  prepare_select_data(Data, N) ->
    prepare_select_data(Data, [], [], N).
  
  prepare_select_data([], [32 | [$a | [$n | [$d | Condition]]]], Values, _N) ->
    {ok, " where" ++ Condition, lists:reverse(Values)};
  prepare_select_data([{Key, null} | T], Con, Vals, N) ->
    Condition = Con ++ " and " ++ atom_to_list(Key) ++ " is null",
    prepare_select_data(T, Condition, Vals, N);
  