Skip to content

Commit

Permalink
fix decode result
Browse files Browse the repository at this point in the history
  • Loading branch information
nakagami committed Mar 31, 2019
1 parent 09a8dec commit fb428c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions lib/firebirdex/query.ex
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ defmodule Firebirdex.Query do

def decode(query, result, _opts) do
columns = :efirebirdsql_protocol.columns(query.stmt)
rows = Enum.map(result.rows, &(convert_row([], columns, &1)))
%Result{result | rows: rows, num_rows: length(rows)}

rows = if result.rows == nil do
result.rows
else
Enum.map(result.rows, &(convert_row([], columns, &1)))
end
%Result{result | rows: rows, num_rows: result.num_rows}
end
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ defmodule Firebirdex.Mixfile do
[
{:db_connection, "~> 2.0"},
{:decimal, "~> 1.6"},
{:efirebirdsql, "~> 0.6.2"},
{:efirebirdsql, "~> 0.6.3"},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false}
]
end
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"db_connection": {:hex, :db_connection, "2.0.6", "bde2f85d047969c5b5800cb8f4b3ed6316c8cb11487afedac4aa5f93fd39abfa", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"},
"decimal": {:hex, :decimal, "1.7.0", "30d6b52c88541f9a66637359ddf85016df9eb266170d53105f02e4a67e00c5aa", [:mix], [], "hexpm"},
"earmark": {:hex, :earmark, "1.3.2", "b840562ea3d67795ffbb5bd88940b1bed0ed9fa32834915125ea7d02e35888a5", [:mix], [], "hexpm"},
"efirebirdsql": {:hex, :efirebirdsql, "0.6.2", "783af4f8c0d09ec4fbfa3b35d95baab218518ef187d774ab6b64919990003778", [:rebar3], [], "hexpm"},
"efirebirdsql": {:hex, :efirebirdsql, "0.6.3", "56113806bba3f405893f62c381959cc43f8e5834928ed6f70a326c2a8a3dc5ac", [:rebar3], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"},
"makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"},
Expand Down

0 comments on commit fb428c8

Please sign in to comment.