anchor.diff:      end.
   
   push(Conn, Depth) ->
  -    case Depth of 0 -> pgsql:squery(Conn, "BEGIN"); _ -> ok end,
  -    pgsql:squery(Conn, "SAVEPOINT savepoint"++integer_to_list(Depth)).
  +    case Depth of 0 -> epgsql:squery(Conn, "BEGIN"); _ -> ok end,
  +    epgsql:squery(Conn, "SAVEPOINT savepoint"++integer_to_list(Depth)).
   
   pop(Conn, Depth) ->
  -    pgsql:squery(Conn, "ROLLBACK TO SAVEPOINT savepoint"++integer_to_list(Depth - 1)).
  +    epgsql:squery(Conn, "ROLLBACK TO SAVEPOINT savepoint"++integer_to_list(Depth - 1)).
   
   dump(_Conn) -> "".
   
   execute(Conn, Commands) ->
  -    pgsql:squery(Conn, Commands).
  +    epgsql:squery(Conn, Commands).
   
   execute(Conn, Commands, Params) ->
  -    pgsql:equery(Conn, Commands, Params).
  +    epgsql:equery(Conn, Commands, Params).
   
   transaction(Conn, TransactionFun) ->
  -    case pgsql:with_transaction(Conn, fun(_C) -> TransactionFun() end) of
  +    case epgsql:with_transaction(Conn, fun(_C) -> TransactionFun() end) of
           {rollback, Reason} -> {aborted, Reason};
           Other -> {atomic, Other}
       end.
   
   get_migrations_table(Conn) ->
  -    Res = pgsql:equery(Conn, "SELECT * FROM schema_migrations", []),
  +    Res = epgsql:equery(Conn, "SELECT * FROM schema_migrations", []),
       case Res of
           {ok, _Columns, ResultRows} ->
               ResultRows;
  
positive.code:     DBPassword  = proplists:get_value(db_password, Options, ""),
      DBDatabase  = proplists:get_value(db_database, Options, "test"),
      DBConfigure = proplists:get_value(db_configure, Options, []),
      pgsql:connect(DBHost, DBUsername, DBPassword, 
          [{port, DBPort}, {database, DBDatabase} | DBConfigure]).
  
  terminate(Conn) ->
      pgsql:close(Conn).
  
  find_by_sql(Conn, Type, Sql, Parameters) when is_atom(Type), is_list(Sql), is_list(Parameters) ->
      case boss_record_lib:ensure_loaded(Type) of
          true ->
              Res = pgsql:equery(Conn, Sql, Parameters),
              case Res of
                  {ok, Columns, ResultRows} ->
                      lists:map(fun(Row) ->
  
negative.code: 
  build_select_query(Type, Conditions, Max, Skip, Sort, SortOrder) ->
      TableName = boss_record_lib:database_table(Type),
      ["SELECT * FROM ", TableName,
          " WHERE ", build_conditions(Type, Conditions),
          " ORDER BY ", atom_to_list(Sort), " ", sort_order_sql(SortOrder),
          case Max of all -> ""; _ -> " LIMIT " ++ integer_to_list(Max) ++
  