Skip to content

Commit

Permalink
Merge pull request #84 from circles-learning-labs/ecto_backwards_compat
Browse files Browse the repository at this point in the history
Maintain backwards compatibility for Ecto 3 minor versions
  • Loading branch information
bernardd authored Mar 22, 2021
2 parents 577ed79 + 4ac2993 commit caec601
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

[v2.x.x -> v3.x.x upgrade guide](/upgrade_guides/version_3_upgrade_guide.md)

## v3.0.1

- Maintain backwards compatibility for Ecto versions 3.0 <= 3.4 - all major version 3 releases of Ecto should now be supported

## v3.0.0

### Enhancements
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Install the [Hex](https://hex.pm/packages/ecto_adapters_dynamodb) package by add
```elixir
defp deps do
[
{:ecto_adapters_dynamodb, "~> 2.0"}
{:ecto_adapters_dynamodb, "~> 3.0"}
]
end
```
Expand All @@ -194,7 +194,7 @@ Otherwise, to fetch from GitHub:
```elixir
defp deps do
[
{:ecto_adapters_dynamodb, git: "https://github.com/circles-learning-labs/ecto_adapters_dynamodb", tag: "2.0.4"}
{:ecto_adapters_dynamodb, git: "https://github.com/circles-learning-labs/ecto_adapters_dynamodb", tag: "3.0.1"}
]
end
```
Expand Down
5 changes: 5 additions & 0 deletions lib/ecto_adapters_dynamodb.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1543,9 +1543,14 @@ defmodule Ecto.Adapters.DynamoDB do
t when t in [:naive_datetime_usec, :naive_datetime] ->
NaiveDateTime.from_iso8601!(val)

# Support for Ecto >= 3.5
{:parameterized, _, _} ->
decode_embed(val, type)

# Support for Ecto 3.0 <= 3.4
{:embed, _} ->
decode_embed(val, type)

_ ->
val
end
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Ecto.Adapters.DynamoDB.Mixfile do
def project do
[
app: :ecto_adapters_dynamodb,
version: "3.0.0",
version: "3.0.1",
elixir: "~> 1.7",
build_embedded: Mix.env() == :prod,
start_permanent: Mix.env() == :prod,
Expand Down
7 changes: 0 additions & 7 deletions upgrade_guides/version_3_upgrade_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ startup. From v3 the adapter will only use the config it's given in the calls it
This may mean that you need to explicitly specify ExAws configuration options outside of the
adapter's config if you're making your own ExAws calls elsewhere.

## Ecto version

Due to changes in version 3.5 of [Ecto](https://github.com/elixir-ecto/ecto), version 3 of this
adapter is only compatible with version 3.5 of Ecto or higher. If you are using a lower version
of Ecto, be aware that upgrading to version 3 of this adapter will necesitate upgrading Ecto to
3.5 or higher as well.

## ExAws.Dynamo version

This release of the adapter includes support for the latest major version of [ExAws.Dynamo](
Expand Down

0 comments on commit caec601

Please sign in to comment.