Skip to content

Commit

Permalink
cherry pick #236
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslandoga committed Feb 3, 2025
1 parent 85f8e87 commit 57c0c05
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/ch/query.ex
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@ defimpl DBConnection.Query, for: Ch.Query do

num_rows =
if summary = get_header(headers, "x-clickhouse-summary") do
%{"written_rows" => written_rows} = Jason.decode!(summary)
String.to_integer(written_rows)
summary = Jason.decode!(summary)

if written_rows = Map.get(summary, "written_rows") do
String.to_integer(written_rows)
end
end

%Result{num_rows: num_rows, rows: nil, command: :insert, headers: headers}
Expand Down

0 comments on commit 57c0c05

Please sign in to comment.