anchor.diff:    start_link/8,
     insert/2,
     select/2,
  +  update/2,
     function/2,
     execute/2
     ]).
  
positive.code: execute(Pid, Query, Values) ->
    trace("calling gen fsm to execute query"),
    gen_fsm:send_event(Pid, {self(), Query, Values}).
  
  prepare_insert_data([]) ->
    {ok, [], [], []};
  
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);
  