anchor.diff:           exec_prepared_select/3]).
   
   -record(state, {cn,
  -                statements = dict:new() :: dict() }).
  +                statements = dict:new() :: dict(),
  +                ctrans :: dict() | undefined }).
   
   -type connection() :: pid().
   -type state() :: any().
  
positive.code:     sqerl_client:start_link(?MODULE, Config).
  
  -spec exec_prepared_select(atom(), [], state()) -> {{ok, [[tuple()]]} | {error, any()}, state()}.
  exec_prepared_select(Name, Args, #state{cn=Cn, statements=Statements}=State) ->
      {Columns, Stmt} = dict:fetch(Name, Statements),
      ok = pgsql:bind(Cn, Stmt, Args),
      %% Note: we might get partial results here for big selects!
  
negative.code:     case Result of
          {ok, RowData} ->
              Rows = unpack_rows(Columns, RowData),
              TRows = sqerl_transformers:by_column_name(Rows, CTrans),
              {{ok, TRows}, State};
          Result ->
              {{error, Result}, State}
      end.
  