Skip to content

Commit

Permalink
Merge pull request #110 from erlangbureau/stage
Browse files Browse the repository at this point in the history
Bump to 0.5.0
  • Loading branch information
vstavskyi authored Apr 28, 2022
2 parents d39753d + 603b3f9 commit 3ad6330
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/jamdb_oracle.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defmodule Jamdb.Oracle do
@vsn "0.4.12"
@vsn "0.5.0"
@moduledoc """
Adapter module for Oracle. `DBConnection` behaviour implementation.
Expand Down Expand Up @@ -204,7 +204,7 @@ defmodule Jamdb.Oracle do
{mode, s}
end

@impl false
@doc false
def checkin(s) do
{:ok, s}
end
Expand Down
9 changes: 9 additions & 0 deletions lib/jamdb_oracle_ecto.ex
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ defmodule Ecto.Adapters.Jamdb.Oracle.Connection do
end
end

@impl true
def query_many(_conn, _query, _params, _opts) do
error!(nil, "query_many is not supported")
end

@impl true
def explain_query(conn, query, params, opts) do
case query(conn, IO.iodata_to_binary(["EXPLAIN PLAN FOR ", query]), params, opts) do
Expand All @@ -121,6 +126,10 @@ defmodule Ecto.Adapters.Jamdb.Oracle.Connection do
query
end

defp error!(nil, msg) do
raise ArgumentError, msg
end

defdelegate all(query), to: Jamdb.Oracle.Query
defdelegate update_all(query), to: Jamdb.Oracle.Query
defdelegate delete_all(query), to: Jamdb.Oracle.Query
Expand Down
6 changes: 3 additions & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ defmodule Jamdb.Oracle.Mixfile do

def project do
[app: :jamdb_oracle,
version: "0.4.12",
elixir: "~> 1.8",
version: "0.5.0",
elixir: "~> 1.10",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
description: description(),
Expand All @@ -14,7 +14,7 @@ defmodule Jamdb.Oracle.Mixfile do

defp deps do
[
{:ecto_sql, "~> 3.7"},
{:ecto_sql, "~> 3.8"},
{:ex_doc, "~> 0.21", only: :docs}
]
end
Expand Down
2 changes: 1 addition & 1 deletion src/jamdb_oracle.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, jamdb_oracle, [
{description, "Erlang driver for Oracle"},
{vsn, "0.4.9"},
{vsn, "0.5.0"},
{modules, []},
{registered, []},
{applications, [kernel,stdlib]},
Expand Down
2 changes: 1 addition & 1 deletion src/jamdb_oracle.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-module(jamdb_oracle).
-vsn("0.4.9").
-vsn("0.5.0").
-behaviour(gen_server).

%% API
Expand Down
14 changes: 14 additions & 0 deletions src/jamdb_oracle_tns_decoder.erl
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,13 @@ lid(N,I,Acc) ->
lid(N bsr 6 band 67108863,I-1,[H|Acc]).

decode_clob(Data) ->
A = decode_next(ub4,Data),
case decode_ub1(A) of
114 -> {[], decode_next(A)}; %LobLocator
_ -> decode_clob_value(Data)
end.

decode_clob_value(Data) ->
A = decode_next(ub4,Data),
B = decode_next(ub4,A), %LobSize
C = decode_next(ub4,B), %LobChunkSize
Expand All @@ -679,6 +686,13 @@ decode_clob(Data) ->
{Value, decode_next(G)}.

decode_blob(Data) ->
A = decode_next(ub4,Data),
case decode_ub1(A) of
114 -> {[], decode_next(A)}; %LobLocator
_ -> decode_blob_value(Data)
end.

decode_blob_value(Data) ->
A = decode_next(ub4,Data),
B = decode_next(ub4,A), %LobSize
C = decode_next(ub4,B), %LobChunkSize
Expand Down

0 comments on commit 3ad6330

Please sign in to comment.