anchor.diff:  terminal_raw_data(_Pid, _Module, _UIN, RawData, Timeout) ->
     trace("terminal raw data"),
     ConnectionID = hooks:get(connection_id),
  -  case execute(1000, insert, {data, raws, [{connection_id, ConnectionID}, {data,  RawData}]}, Timeout) of
  +  RawID = now2id(),
  +  case execute(1000, insert, {data, raws, [{id, RawID}, {connection_id, ConnectionID}, {data,  RawData}]}, Timeout) of
       {ok, 0} ->
         debug("data repeat"),
         hooks:delete(raw_id),
         stop;
       {ok, RawID} ->
  +      debug("raw id is ~w", [RawID]),
         hooks:set(raw_id, RawID),
         ok
     end.
  
positive.code:   {ok, {LocalIP, LocalPort}} = inet:sockname(Socket),
    Query = "
    with data_id as (
      insert into data.connections (protocol, type)
        values ($1, 'ip')
        returning id
    ) insert into connections.ip_data
        select D.id, $2, $3, $4, $5
          from data_id D returning id",
    S = execute(1000, execute, {Query, [Proto, LocalIP, LocalPort, RemoteIP, RemotePort]}, Timeout),
    debug ("returned ~w", [S]),
    {ok, ConnectionID} = S,
    hooks:set(Pid, connection_id, ConnectionID),
  
negative.code:     ->
    {ok, 0};
  insert_terminal_raw_packet(RawID, RawPacket, Type, Timeout) ->
    execute(1000, insert, {data, packets, [{id, now2id()}, {raw_id, RawID}, {data, RawPacket}, {type, Type}]}, Timeout).
  
  
  insert_terminal_packet(PacketID, _Module, Type, _Table, _Packet, _Timeout)
  