anchor.diff:      end,
       {reply, {ok, Value}, State}.
   
  -handle_cast({connect, From, Ref, Host, Username, Password, Opts},
  +handle_cast(Req = {{_, _}, {connect, Host, Username, Password, Opts}},
               #state{queue = Queue} = State) ->
       Timeout = proplists:get_value(timeout, Opts, 5000),
       Port = proplists:get_value(port, Opts, 5432),
  
positive.code:     put(password, Password),
      {noreply,
       State2#state{handler = auth,
                    queue = queue:in({connect, From, Ref}, Queue),
                    async = Async}};
  
  handle_cast(stop, #state{queue = Queue} = State) ->
      %% TODO flush queue
      {stop, normal, State};
  
  handle_cast({parse, From, Ref, Name, Sql, Types}, State) ->
      #state{queue = Queue} = State,
      Bin = pgsql_wire:encode_types(Types),
      send(State, $P, [Name, 0, Sql, 0, Bin]),
      send(State, $D, [$S, Name, 0]),
      send(State, $H, []),
      S = #statement{name = Name},
      {noreply, State#state{queue = queue:in({parse, From, Ref}, Queue)}};
  
  handle_cast(cancel, State = #state{backend = {Pid, Key}}) ->
      {ok, {Addr, Port}} = inet:peername(State#state.sock),
  
negative.code: -behavior(gen_server).
  
  -export([start_link/0,
           connect/5,
           close/1,
           get_parameter/2,
           squery/2,
           equery/3,
           parse/4,
           bind/4,
           execute/4,
           describe/3,
           close/3,
           sync/1,
           cancel/1]).
  
  -export([handle_call/3, handle_cast/2, handle_info/2]).
  