|
@@ -36,7 +36,8 @@
|
|
|
-type response() :: [{ok, Count :: non_neg_integer(), Rows :: [tuple()]}
|
|
|
| {ok, Count :: non_neg_integer()}
|
|
|
| {ok, Rows :: [tuple()]}
|
|
|
- | {error, epgsql:query_error()}].
|
|
|
+ | {error, epgsql:query_error()}
|
|
|
+ ].
|
|
|
-type state() :: #batch{}.
|
|
|
|
|
|
-spec init(arguments()) -> state().
|
|
@@ -110,8 +111,7 @@ handle_message(?COMMAND_COMPLETE, Bin, Sock,
|
|
|
{ok, Rows}
|
|
|
end,
|
|
|
{add_result, Result, {complete, Complete}, Sock, State#batch{batch = Batch}};
|
|
|
-handle_message(?READY_FOR_QUERY, _Status, Sock, #batch{batch = B} = _State) when
|
|
|
- length(B) =< 1 ->
|
|
|
+handle_message(?READY_FOR_QUERY, _Status, Sock, _State) ->
|
|
|
Results = epgsql_sock:get_results(Sock),
|
|
|
{finish, Results, done, Sock};
|
|
|
handle_message(?ERROR, Error, Sock, #batch{batch = [_ | Batch]} = State) ->
|