Anton Lebedevich 13 years ago
parent
commit
5ae2539f79
2 changed files with 4 additions and 3 deletions
  1. 1 1
      src/pgsql.erl
  2. 3 2
      src/pgsql_sock.erl

+ 1 - 1
src/pgsql.erl

@@ -48,8 +48,8 @@ squery(C, Sql) ->
 equery(C, Sql) ->
 equery(C, Sql) ->
     equery(C, Sql, []).
     equery(C, Sql, []).
 
 
+%% TODO add fast_equery command that doesn't need parsed statement
 equery(C, Sql, Parameters) ->
 equery(C, Sql, Parameters) ->
-    %% TODO don't require reply from 'describe'
     case parse(C, Sql) of
     case parse(C, Sql) of
         {ok, #statement{types = Types} = S} ->
         {ok, #statement{types = Types} = S} ->
             Typed_Parameters = lists:zip(Types, Parameters),
             Typed_Parameters = lists:zip(Types, Parameters),

+ 3 - 2
src/pgsql_sock.erl

@@ -136,14 +136,15 @@ handle_cast(Req = {_, {squery, Sql}}, State) ->
     send(State, $Q, [Sql, 0]),
     send(State, $Q, [Sql, 0]),
     {noreply, State#state{queue = queue:in(Req, Q)}};
     {noreply, State#state{queue = queue:in(Req, Q)}};
 
 
+%% TODO add fast_equery command that doesn't need parsed statement,
+%% uses default (text) column format,
+%% sends Describe after Bind to get RowDescription
 handle_cast(Req = {_, {equery, Statement, Parameters}}, State) ->
 handle_cast(Req = {_, {equery, Statement, Parameters}}, State) ->
     #state{queue = Q} = State,
     #state{queue = Q} = State,
     #statement{name = StatementName, columns = Columns} = Statement,
     #statement{name = StatementName, columns = Columns} = Statement,
     Bin1 = pgsql_wire:encode_parameters(Parameters),
     Bin1 = pgsql_wire:encode_parameters(Parameters),
-    %% TODO do we really need Columns here?
     Bin2 = pgsql_wire:encode_formats(Columns),
     Bin2 = pgsql_wire:encode_formats(Columns),
     send(State, $B, ["", 0, StatementName, 0, Bin1, Bin2]),
     send(State, $B, ["", 0, StatementName, 0, Bin1, Bin2]),
-    %% TODO send Describe there
     send(State, $E, ["", 0, <<0:?int32>>]),
     send(State, $E, ["", 0, <<0:?int32>>]),
     send(State, $C, [$S, "", 0]),
     send(State, $C, [$S, "", 0]),
     send(State, $S, []),
     send(State, $S, []),