anchor.diff:           exec_prepared_statement/3,
            exec_prepared_select/3]).
   
  --record(state, {cn,
  -                statements = dict:new() :: dict(),
  -                ctrans :: dict() | undefined }).
  +-record(state, 
  +        {cn,
  +         statements = dict:new() :: dict(),
  +         ctrans :: dict() | undefined }).
  +
  +-record(prepared_statement, 
  +        {name :: string(),
  +         input_types  :: any(),
  +         output_fields :: any(),
  +         stmt :: any() } ).
   
   -type connection() :: pid().
   -type state() :: any().
  
positive.code: 
  -spec exec_prepared_statement(atom(), [], any()) -> {{ok, integer()} | {error, any()}, state()}.
  exec_prepared_statement(Name, Args, #state{cn=Cn, statements=Statements}=State) ->
      {_Columns, Stmt} = dict:fetch(Name, Statements),
      NArgs = input_transforms(Args, State),
      ok = pgsql:bind(Cn, Stmt, NArgs),
      %% Note: we might get partial results here for big selects!
      Rv =
          try 
  
negative.code: 
  -spec exec_prepared_select(atom(), [], state()) -> {{ok, [[tuple()]]} | {error, any()}, state()}.
  exec_prepared_select(Name, Args, #state{cn=Cn, statements=Statements, ctrans=CTrans}=State) ->
      PrepStmt = dict:fetch(Name, Statements),
      Stmt = PrepStmt#prepared_statement.stmt,
      NArgs = input_transforms(Args,State),
      ok = pgsql:bind(Cn, Stmt, NArgs),
      %% Note: we might get partial results here for big selects!
      Result = pgsql:execute(Cn, Stmt),
      case Result of
          {ok, RowData} ->
              Rows = unpack_rows(PrepStmt, RowData),
              TRows = sqerl_transformers:by_column_name(Rows, CTrans),
              {{ok, TRows}, State};
          Result ->
  